diff options
author | Miao Wang <miaowang@google.com> | 2016-02-25 12:44:10 -0800 |
---|---|---|
committer | Miao Wang <miaowang@google.com> | 2016-02-26 00:53:46 +0000 |
commit | 68e00893f7400d1ce71a9ed92365ffdfd6730c03 (patch) | |
tree | d4e0055948261b264feb64085e635f3456aaab4c /cpu_ref/rsCpuScript.cpp | |
parent | 464c8cc19dacc544a16b2a0ffb104d4a4c25753b (diff) | |
download | rs-68e00893f7400d1ce71a9ed92365ffdfd6730c03.tar.gz |
Better handle error log and nullptr reference.
Bug: 27367378
Change-Id: Ide29c702d7a70dfe087ddc600d3fd17279223196
Diffstat (limited to 'cpu_ref/rsCpuScript.cpp')
-rw-r--r-- | cpu_ref/rsCpuScript.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cpu_ref/rsCpuScript.cpp b/cpu_ref/rsCpuScript.cpp index 508381f0..16b3ec60 100644 --- a/cpu_ref/rsCpuScript.cpp +++ b/cpu_ref/rsCpuScript.cpp @@ -674,6 +674,12 @@ bool RsdCpuScriptImpl::forEachMtlsSetup(const Allocation ** ains, const void * usr, uint32_t usrLen, const RsScriptCall *sc, MTLaunchStructForEach *mtls) { + if (ains == nullptr && inLen != 0) { + mCtx->getContext()->setError(RS_ERROR_BAD_SCRIPT, + "rsForEach called with none-zero inLen with null in allocations"); + return false; + } + memset(mtls, 0, sizeof(MTLaunchStructForEach)); mtls->dimPtr = &mtls->fep.dim; |