From 1d63cc3b6d5d4c3d09ade408e975d9dce41f84fd Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Wed, 18 Apr 2018 10:25:45 -0700 Subject: [PATCH] Set default reference ID The reference ID may not be set [when the reference ID is 0x00], so, we need to ensure it has a proper default value; instead of garbage Change-Id: Ie1bcf062fbb1aab5832cf210f68b24732af5dc3b Fixes: 74389717 Test: Run gReader and see that it doesn't crash --- core/jni/android_util_AssetManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp index 8be6ed8c415d8..7fa224757fd29 100644 --- a/core/jni/android_util_AssetManager.cpp +++ b/core/jni/android_util_AssetManager.cpp @@ -837,7 +837,7 @@ static jint NativeGetResourceArray(JNIEnv* env, jclass /*clazz*/, jlong ptr, jin ResTable_config selected_config; selected_config.density = 0; uint32_t flags = bag->type_spec_flags; - uint32_t ref; + uint32_t ref = 0; ApkAssetsCookie cookie = assetmanager->ResolveReference(entry.cookie, &value, &selected_config, &flags, &ref); if (cookie == kInvalidCookie) {