catch the other case where we need to see if fScaledBitmap.lockPixels() might have...
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 16 Oct 2013 19:13:29 +0000 (19:13 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 16 Oct 2013 19:13:29 +0000 (19:13 +0000)
2nd-half clone of https://codereview.chromium.org/26273006/

BUG=chromium:295895

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

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

src/core/SkBitmapProcState.cpp

index db446a2..c50266f 100644 (file)
@@ -299,6 +299,11 @@ bool SkBitmapProcState::lockBaseBitmap() {
         }
     }
     fScaledBitmap.lockPixels(); // just 'cause the cache made a copy :(
+    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;
     return true;
 }