From c360bef7bcf98e0ae50461524f1ae08ee3a9c609 Mon Sep 17 00:00:00 2001 From: John Reck Date: Wed, 22 Jul 2015 13:55:48 -0700 Subject: [PATCH] Fix ATLAS_MAP_ENTRY_FIELD_COUNT Bug: 22558805 Change a039182d6157bc0487df4ad8e373685c9dd7d662 reduced the size of an entry from 4 fields to 3, but failed to update the constant that determined the size of the java long[]. Because the long[] is blindly passed down through to native, this will result in reading past the end of the array as the size is no longer a multiple of the number of fields being read so the loop will not terminate until 1 iteration past the end. Change-Id: I2f8e26cec9a60b3a74739a3763203296be5f1fd6 --- services/core/java/com/android/server/AssetAtlasService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/AssetAtlasService.java b/services/core/java/com/android/server/AssetAtlasService.java index ebc810f3a6e17..4569daee029eb 100644 --- a/services/core/java/com/android/server/AssetAtlasService.java +++ b/services/core/java/com/android/server/AssetAtlasService.java @@ -93,7 +93,7 @@ public class AssetAtlasService extends IAssetAtlas.Stub { // Defines the number of int fields used to represent a single entry // in the atlas map. This number defines the size of the array returned // by the getMap(). See the mAtlasMap field for more information - private static final int ATLAS_MAP_ENTRY_FIELD_COUNT = 4; + private static final int ATLAS_MAP_ENTRY_FIELD_COUNT = 3; // Specifies how our GraphicBuffer will be used. To get proper swizzling // the buffer will be written to using OpenGL (from JNI) so we can leave