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

Unified Diff: src/images/SkImageDecoder_libjpeg.cpp

Issue 858333002: Muck with the right cinfo. (Closed) Base URL: https://skia.googlesource.com/skia.git@anotherFix
Patch Set: Set the error manager to both cinfos Created 5 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder_libjpeg.cpp
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp
index e0722e18dc60972719d2634fa06c48dd58070b4e..3c93e6177ddf0773a42bcdc4b935c4317d62f1e6 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -940,10 +940,9 @@ bool SkJPEGImageDecoder::onDecodeYUV8Planes(SkStream* stream, SkISize componentS
bool SkJPEGImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, int *width, int *height) {
SkAutoTDelete<SkJPEGImageIndex> imageIndex(SkNEW_ARGS(SkJPEGImageIndex, (stream, this)));
- jpeg_decompress_struct* cinfo = imageIndex->cinfo();
skjpeg_error_mgr sk_err;
- set_error_mgr(cinfo, &sk_err);
+ set_error_mgr(imageIndex->cinfo(), &sk_err);
// All objects need to be instantiated before this setjmp call so that
// they will be cleaned up properly if an error occurs.
@@ -968,6 +967,10 @@ bool SkJPEGImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, int *width
return false;
}
+ jpeg_decompress_struct* cinfo = imageIndex->cinfo();
+ // We have a new cinfo, so set the error mgr again.
+ set_error_mgr(cinfo, &sk_err);
+
// FIXME: This sets cinfo->out_color_space, which we may change later
// based on the config in onDecodeSubset. This should be fine, since
// jpeg_init_read_tile_scanline will check out_color_space again after
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698