Index: src/core/SkPicture.cpp |
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp |
index a1aa35e61e09f1447e65f70271d9c49cd3db46d6..18e229ca233f182effd9168f241fd1641e6400d3 100644 |
--- a/src/core/SkPicture.cpp |
+++ b/src/core/SkPicture.cpp |
@@ -310,7 +310,12 @@ SkPicture* SkPicture::CreateFromStream(SkStream* stream, InstallPixelRefProc pro |
SkPicturePlayback* playback; |
// Check to see if there is a playback to recreate. |
if (stream->readBool()) { |
- playback = SkNEW_ARGS(SkPicturePlayback, (stream, info, proc)); |
+ bool isValid = false; |
caryclark
2013/09/26 21:12:46
It looks like this argues for creating a SkPicture
reed1
2013/09/26 21:16:07
+1
scroggo
2013/09/26 22:17:46
I think that is generally a better pattern (this c
|
+ playback = SkNEW_ARGS(SkPicturePlayback, (stream, info, &isValid, proc)); |
+ if (!isValid) { |
+ SkDELETE(playback); |
+ return NULL; |
+ } |
} else { |
playback = NULL; |
} |