From: reed@google.com Date: Mon, 30 Jul 2012 13:16:35 +0000 (+0000) Subject: detect null pixles in setPixels() and just clear out any existing pixelref. X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~15391 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e1034e9ca0e3009f65125239e21b06ec51a55a6;p=platform%2Fupstream%2FlibSkiaSharp.git 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 --- diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index 687cf7a..f135d48 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());