summaryrefslogtreecommitdiffstats
path: root/rsScriptC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rsScriptC.cpp')
-rw-r--r--rsScriptC.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index e1685b91..a24334e3 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -192,6 +192,15 @@ void ScriptC::runForEach(Context *rsc,
const void * usr,
size_t usrBytes,
const RsScriptCall *sc) {
+ // Make a copy of RsScriptCall and zero out extra fields that are absent
+ // in API levels below 23.
+ RsScriptCall sc_copy;
+ if (sc != nullptr && getApiLevel() < 23) {
+ memset(&sc_copy, 0, sizeof(sc_copy));
+ memcpy(&sc_copy, sc, 7*4);
+ sc = &sc_copy;
+ }
+
// Trace this function call.
// To avoid overhead we only build the string if tracing is actually
// enabled.