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

Unified Diff: src/images/SkImageDecoder_libwebp.cpp

Issue 22861028: Handle SkStream::rewind properly. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Another comment rewrite. Created 7 years, 4 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
« no previous file with comments | « src/images/SkImageDecoder_libpng.cpp ('k') | src/images/SkImageRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/images/SkImageDecoder_libpng.cpp ('k') | src/images/SkImageRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698