summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Leon Scroggins <scroggo@google.com> 2016-02-03 13:49:28 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-02-03 13:49:28 +0000
commit5e4aa93df6486af3043afb7edc8aa8b8e8f61bbc (patch)
treee93de63ac2ff600af22bd065df956c8466c4536a
parentb63065736206b0d04fc18523047c9eb5f250f503 (diff)
parent66ce1c3b1a7b5ed3d4d5a9a05a7c133998c9a73e (diff)
Merge "Lock SkBitmap before accessing color table"
-rwxr-xr-xcore/jni/android/graphics/Bitmap.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp
index 80ccb614ad73..43e26b332f11 100755
--- a/core/jni/android/graphics/Bitmap.cpp
+++ b/core/jni/android/graphics/Bitmap.cpp
@@ -1087,6 +1087,8 @@ static jboolean Bitmap_writeToParcel(JNIEnv* env, jobject,
p->writeInt32(density);
if (bitmap.colorType() == kIndex_8_SkColorType) {
+ // The bitmap needs to be locked to access its color table.
+ SkAutoLockPixels alp(bitmap);
SkColorTable* ctable = bitmap.getColorTable();
if (ctable != NULL) {
int count = ctable->count();