aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-30 13:16:35 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-30 13:16:35 +0000
commit8e1034e9ca0e3009f65125239e21b06ec51a55a6 (patch)
tree604a395fc7b33696eefa37d861084317c91dc1df
parentcddaf340f1474cc1ff429b8ef9bc8739c72f80ba (diff)
detect null pixles in setPixels() and just clear out any existing pixelref.
git-svn-id: http://skia.googlecode.com/svn/trunk@4827 2bbb7eff-a529-9590-31e7-b0007b416f81
-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());