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

Unified Diff: src/images/SkJpegUtility.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/SkImageRef.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkJpegUtility.cpp
diff --git a/src/images/SkJpegUtility.cpp b/src/images/SkJpegUtility.cpp
index 8d8f62f5a243f57438a7be44456e32f15a42deb9..1ec9f00d9562e2b5cd4466bea2e0a62c98181906 100644
--- a/src/images/SkJpegUtility.cpp
+++ b/src/images/SkJpegUtility.cpp
@@ -16,7 +16,10 @@ static void sk_init_source(j_decompress_ptr cinfo) {
#ifdef SK_BUILD_FOR_ANDROID
src->current_offset = 0;
#endif
- src->fStream->rewind();
+ if (!src->fStream->rewind()) {
+ SkDebugf("xxxxxxxxxxxxxx failure to rewind\n");
+ cinfo->err->error_exit((j_common_ptr)cinfo);
+ }
}
#ifdef SK_BUILD_FOR_ANDROID
@@ -27,7 +30,11 @@ static boolean sk_seek_input_data(j_decompress_ptr cinfo, long byte_offset) {
if (bo > src->current_offset) {
(void)src->fStream->skip(bo - src->current_offset);
} else {
- src->fStream->rewind();
+ if (!src->fStream->rewind()) {
+ SkDebugf("xxxxxxxxxxxxxx failure to rewind\n");
+ cinfo->err->error_exit((j_common_ptr)cinfo);
+ return false;
+ }
(void)src->fStream->skip(bo);
}
« no previous file with comments | « src/images/SkImageRef.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698