summaryrefslogtreecommitdiff
path: root/cpu_ref/rsCpuScript.cpp
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2013-02-22 17:56:56 -0800
committerTim Murray <timmurray@google.com>2013-02-25 15:32:46 -0800
commit3a25fdd3786c1a08b783d8a83ef94b756347ff5c (patch)
tree9ab8a2c5a2da28420660541fb92946abe25c54af /cpu_ref/rsCpuScript.cpp
parent14982c8eb9a17a95a817c1fd2571829be5b7017e (diff)
Cleanup lots of things related to IO_OUTPUT and error checking.
Change-Id: Ic6802dd0ba9d3edc8c53f99002cdd905214a515c
Diffstat (limited to 'cpu_ref/rsCpuScript.cpp')
-rw-r--r--cpu_ref/rsCpuScript.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/cpu_ref/rsCpuScript.cpp b/cpu_ref/rsCpuScript.cpp
index 257655ab..80f8ea01 100644
--- a/cpu_ref/rsCpuScript.cpp
+++ b/cpu_ref/rsCpuScript.cpp
@@ -175,6 +175,16 @@ void RsdCpuScriptImpl::forEachMtlsSetup(const Allocation * ain, Allocation * aou
memset(mtls, 0, sizeof(MTLaunchStruct));
+ // possible for this to occur if IO_OUTPUT/IO_INPUT with no bound surface
+ if (ain && (const uint8_t *)ain->mHal.drvState.lod[0].mallocPtr == NULL) {
+ mCtx->getContext()->setError(RS_ERROR_BAD_SCRIPT, "rsForEach called with null allocations");
+ return;
+ }
+ if (aout && (const uint8_t *)aout->mHal.drvState.lod[0].mallocPtr == NULL) {
+ mCtx->getContext()->setError(RS_ERROR_BAD_SCRIPT, "rsForEach called with null allocations");
+ return;
+ }
+
if (ain) {
mtls->fep.dimX = ain->getType()->getDimX();
mtls->fep.dimY = ain->getType()->getDimY();