Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1059)

Unified Diff: src/core/SkBitmapDevice.cpp

Issue 196223013: check for null-device pixels in onWritePixels, so we don't crash (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« gm/stroketext.cpp ('K') | « gm/stroketext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapDevice.cpp
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 8524f0b72b4312746d10a307767bda14b6e7acb8..724f17fe51c8c53c7e509c982d2dfc22220f3b2a 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -352,6 +352,11 @@ static bool write_pixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dst
bool SkBitmapDevice::onWritePixels(const SkImageInfo& srcInfo, const void* srcPixels,
size_t srcRowBytes, int x, int y) {
+ // since we don't stop creating un-pixeled devices yet, check for no pixels here
+ if (NULL == fBitmap.getPixels()) {
+ return false;
+ }
+
SkImageInfo dstInfo = fBitmap.info();
dstInfo.fWidth = srcInfo.width();
dstInfo.fHeight = srcInfo.height();
« gm/stroketext.cpp ('K') | « gm/stroketext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698