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); |
} |