diff options
author | Pirama Arumuga Nainar <pirama@google.com> | 2015-04-28 14:40:45 -0700 |
---|---|---|
committer | Pirama Arumuga Nainar <pirama@google.com> | 2015-04-29 17:50:12 +0000 |
commit | 441104d6b802ab14f67af8e8e55570de1fcc9de6 (patch) | |
tree | 7af48900284efbdf2a1dfd54fa324a4593804548 /rsScriptC_Lib.cpp | |
parent | d57865a769071ccde7acc5287fb25a0f31bd0a4d (diff) | |
download | rs-441104d6b802ab14f67af8e8e55570de1fcc9de6.tar.gz |
Handle older structure sizes by zeroing new fields
Bug 19734267
Bug 19866850
Prior fix handled only rsForEach calls from a script. It is not
sufficient, as launch options in support library also will also use old
structures. Apps compiled for support library still run in native mode
when available, thus necessitating this fix.
This fix copies and extends the input in ScriptC::runForEach instead of
rsrForEach.
Change-Id: I3bb2527eadcbcdb85a76a1f5568269bbfdee972b
(cherry-pick of 9479e5bf0152ecff022cd374e2e80905f88b1a5d from AOSP)
Diffstat (limited to 'rsScriptC_Lib.cpp')
-rw-r--r-- | rsScriptC_Lib.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/rsScriptC_Lib.cpp b/rsScriptC_Lib.cpp index cc930211..c404bde9 100644 --- a/rsScriptC_Lib.cpp +++ b/rsScriptC_Lib.cpp @@ -238,30 +238,17 @@ void rsrForEach(Context *rsc, Script *target, Allocation *in, Allocation *out, const void *usr, uint32_t usrBytes, - const RsScriptCall *call, - const Script *callingScript) { - - RsScriptCall c, *cptr = nullptr; - memset(&c, 0, sizeof(c)); - if (call != nullptr) { - cptr = &c; - if (callingScript->getApiLevel() < 23) { - // Up to API 23, the structure was smaller and we need to zero extend - memcpy(&c, call, 7*4); - } else { - c = *call; - } - } + const RsScriptCall *call) { if (in == nullptr) { target->runForEach(rsc, /* root slot */ 0, nullptr, 0, out, usr, - usrBytes, cptr); + usrBytes, call); } else { const Allocation *ins[1] = {in}; target->runForEach(rsc, /* root slot */ 0, ins, sizeof(ins) / sizeof(RsAllocation), out, usr, - usrBytes, cptr); + usrBytes, call); } } |