aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/SkMipMap.cpp4
-rw-r--r--src/core/SkPixelRef.cpp6
2 files changed, 7 insertions, 3 deletions
diff --git a/src/core/SkMipMap.cpp b/src/core/SkMipMap.cpp
index 77e0abc051..032a60d0f1 100644
--- a/src/core/SkMipMap.cpp
+++ b/src/core/SkMipMap.cpp
@@ -239,6 +239,10 @@ SkMipMap* SkMipMap::Build(const SkBitmap& src, SkDiscardableFactoryProc fact) {
return NULL;
}
const SkPixmap& srcPixmap = srcUnlocker.pixmap();
+ // Try to catch where we might have returned NULL for src crbug.com/492818
+ if (NULL == srcPixmap.addr()) {
+ sk_throw();
+ }
SkMipMap* mipmap;
if (fact) {
diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp
index c5aa3d130d..4d65268820 100644
--- a/src/core/SkPixelRef.cpp
+++ b/src/core/SkPixelRef.cpp
@@ -199,7 +199,7 @@ bool SkPixelRef::lockPixelsInsideMutex() {
}
}
validate_pixels_ctable(fInfo, fRec.fPixels, fRec.fColorTable);
- return true;
+ return fRec.fPixels != NULL;
}
// For historical reasons, we always inc fLockCount, even if we return false.
@@ -224,7 +224,7 @@ bool SkPixelRef::lockPixels() {
}
}
validate_pixels_ctable(fInfo, fRec.fPixels, fRec.fColorTable);
- return true;
+ return fRec.fPixels != NULL;
}
bool SkPixelRef::lockPixels(LockRec* rec) {
@@ -274,7 +274,7 @@ bool SkPixelRef::requestLock(const LockRequest& request, LockResult* result) {
}
}
validate_pixels_ctable(fInfo, result->fPixels, result->fCTable);
- return true;
+ return result->fPixels != NULL;
}
bool SkPixelRef::lockPixelsAreWritable() const {