check of fScaledBitmap failed to lock
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 16 Oct 2013 17:34:17 +0000 (17:34 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 16 Oct 2013 17:34:17 +0000 (17:34 +0000)
BUG=

Review URL: https://codereview.chromium.org/27530003

git-svn-id: http://skia.googlecode.com/svn/trunk@11816 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkBitmapProcState.cpp

index 69af8b9..db446a2 100644 (file)
@@ -159,6 +159,12 @@ bool SkBitmapProcState::possiblyScaleImage() {
                                                             fScaledBitmap);
         }
         fScaledBitmap.lockPixels(); // wonder if Resize() should have locked this
+        if (!fScaledBitmap.getPixels()) {
+            // TODO: find out how this can happen, and add a unittest to exercise
+            // inspired by BUG=chromium:295895
+            return false;
+        }
+
         fBitmap = &fScaledBitmap;
 
         // set the inv matrix type to translate-only;