From 665b2cca88e25b821a69c9ce8a4fd7f551532012 Mon Sep 17 00:00:00 2001 From: "scroggo@google.com" Date: Mon, 6 May 2013 18:08:05 +0000 Subject: lockPixels before calling getColorTable. Fixes a bug where we try to dereference a NULL pointer. Update the comment for SkBitmap::getColorTable, telling the client that pixels must be locked for it to return non-NULL. R=edisonn@google.com Review URL: https://codereview.chromium.org/15002002 git-svn-id: http://skia.googlecode.com/svn/trunk@9018 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/pdf/SkPDFImage.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pdf') diff --git a/src/pdf/SkPDFImage.cpp b/src/pdf/SkPDFImage.cpp index 04307be77e..102bd58b53 100644 --- a/src/pdf/SkPDFImage.cpp +++ b/src/pdf/SkPDFImage.cpp @@ -321,6 +321,7 @@ SkPDFImage::SkPDFImage(SkStream* imageData, insertName("ColorSpace", "DeviceGray"); } else if (config == SkBitmap::kIndex8_Config || config == SkBitmap::kRLE_Index8_Config) { + SkAutoLockPixels alp(bitmap); insert("ColorSpace", makeIndexedColorSpace(bitmap.getColorTable()))->unref(); } else { -- cgit v1.2.3