Index: src/images/SkImageDecoder_libwebp.cpp |
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp |
index 9f1116e5d5bbbd51c8e168f12d8db99d585f07f6..7fb1cf0e312194e9f5c17ffb6fc4d0806adc9886 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!"); |
+ 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; |