aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-16 19:13:29 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-16 19:13:29 +0000
commit4cc18156c2f998135eaff6eea7a8a0696dc98ec9 (patch)
treed06200064c380d5b78f8e78cb73ef8d4395a3ba2
parent34150b451da7d3c70a2d34e67b0285cb36932d45 (diff)
catch the other case where we need to see if fScaledBitmap.lockPixels() might have failed
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
-rw-r--r--src/core/SkBitmapProcState.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index db446a2445..c50266f017 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -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;
}