aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkBitmap.cpp')
-rw-r--r--src/core/SkBitmap.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 687cf7a000..f135d48fa4 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -360,6 +360,11 @@ bool SkBitmap::lockPixelsAreWritable() const {
}
void SkBitmap::setPixels(void* p, SkColorTable* ctable) {
+ if (NULL == p) {
+ this->setPixelRef(NULL, 0);
+ return;
+ }
+
Sk64 size = this->getSize64();
SkASSERT(!size.isNeg() && size.is32());