From a0eabfbc413cf6ee0659ac19243efc5ba2d0f733 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Wed, 18 Dec 2013 16:21:30 -0800 Subject: [PATCH] Fix improper declaration/use of pointer. https://code.google.com/p/android/issues/detail?id=61547 This variable is shadowing the outer "ptr" declaration, resulting in a potential NULL pointer being passed to the message API. Change-Id: If96bfae8d5e874e12597182678a180ba137b78da --- rs/jni/android_renderscript_RenderScript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp index 619e737a33ab8..ece7a40739e8a 100644 --- a/rs/jni/android_renderscript_RenderScript.cpp +++ b/rs/jni/android_renderscript_RenderScript.cpp @@ -392,7 +392,7 @@ nContextSendMessage(JNIEnv *_env, jobject _this, jlong con, jint id, jintArray d jint len = 0; if (data) { len = _env->GetArrayLength(data); - jint *ptr = _env->GetIntArrayElements(data, NULL); + ptr = _env->GetIntArrayElements(data, NULL); } LOG_API("nContextSendMessage, con(%p), id(%i), len(%i)", con, id, len); rsContextSendMessage((RsContext)con, id, (const uint8_t *)ptr, len * sizeof(int));