Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e4aa93d authored by Leon Scroggins's avatar Leon Scroggins Committed by Android (Google) Code Review
Browse files

Merge "Lock SkBitmap before accessing color table"

parents b6306573 66ce1c3b
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1087,6 +1087,8 @@ static jboolean Bitmap_writeToParcel(JNIEnv* env, jobject,
    p->writeInt32(density);
    p->writeInt32(density);


    if (bitmap.colorType() == kIndex_8_SkColorType) {
    if (bitmap.colorType() == kIndex_8_SkColorType) {
        // The bitmap needs to be locked to access its color table.
        SkAutoLockPixels alp(bitmap);
        SkColorTable* ctable = bitmap.getColorTable();
        SkColorTable* ctable = bitmap.getColorTable();
        if (ctable != NULL) {
        if (ctable != NULL) {
            int count = ctable->count();
            int count = ctable->count();