Index: src/core/SkReadBuffer.cpp |
diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp |
index ca89022d12f64069635f3fb70a91173bb65b002b..6823a6cd8e7c1d51c9aebc531b895b5081fa0ea1 100644 |
--- a/src/core/SkReadBuffer.cpp |
+++ b/src/core/SkReadBuffer.cpp |
@@ -313,7 +313,13 @@ SkImage* SkReadBuffer::readImage() { |
} |
const SkIRect subset = SkIRect::MakeXYWH(originX, originY, width, height); |
- return SkImage::NewFromEncoded(encoded, &subset); |
+ SkImage* image = SkImage::NewFromEncoded(encoded, &subset); |
+ if (image) { |
+ return image; |
+ } |
+ |
+ return SkImage::NewFromGenerator( |
+ new EmptyImageGenerator(SkImageInfo::MakeN32Premul(width, height))); |
} |
SkTypeface* SkReadBuffer::readTypeface() { |