Index: src/images/SkImageDecoder_libwebp.cpp |
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp |
index 9f1116e5d5bbbd51c8e168f12d8db99d585f07f6..ef2ee6aa62a8db0c018a55e528cd79fdbf08afa9 100644 |
--- a/src/images/SkImageDecoder_libwebp.cpp |
+++ b/src/images/SkImageDecoder_libwebp.cpp |
@@ -199,7 +199,10 @@ static bool webp_idecode(SkStream* stream, WebPDecoderConfig* config) { |
return false; |
} |
- stream->rewind(); |
+ if (!stream->rewind()) { |
+ SkDEBUGF(("Failed to rewind webp stream!")); |
djsollen
2013/08/22 19:59:18
should we always print this?
scroggo
2013/08/23 21:14:07
Any reason not to? This will tell the caller that
djsollen
2013/08/25 17:47:19
I agree that we should print this always. That i
scroggo
2013/08/26 16:37:47
Ah, now I understand your comment. I didn't know t
|
+ return false; |
+ } |
const size_t readBufferSize = stream->hasLength() ? |
SkTMin(stream->getLength(), WEBP_IDECODE_BUFFER_SZ) : WEBP_IDECODE_BUFFER_SZ; |
SkAutoMalloc srcStorage(readBufferSize); |
@@ -311,7 +314,11 @@ bool SkWEBPImageDecoder::onBuildTileIndex(SkStream* stream, |
return false; |
} |
- stream->rewind(); |
+ if (!stream->rewind()) { |
+ SkDEBUGF(("Failed to rewind webp stream!")); |
+ return false; |
+ } |
+ |
*width = origWidth; |
*height = origHeight; |