aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/images
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2015-01-21 15:08:10 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-21 15:08:10 -0800
commitaa7079b4a19e6d53040c4fb5cd62f2dd39c2595e (patch)
tree4512aa4c2733a03a6f3db265024dcb30445ca16d /src/images
parent3629865bac20ae8092177f519594f79f89d09fb0 (diff)
Revert of Muck with the right cinfo. (patchset #2 id:20001 of https://codereview.chromium.org/858333002/)
Reason for revert: Appears to cause Android dm to segfault. Original issue's description: > Muck with the right cinfo. > > In SkImageDecoder_libjpeg, modify cinfo *after* destroying it and > creating a new one in its place. > > Should fix build breakage. > > Committed: https://skia.googlesource.com/skia/+/3629865bac20ae8092177f519594f79f89d09fb0 TBR=scroggo@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/858323003
Diffstat (limited to 'src/images')
-rw-r--r--src/images/SkImageDecoder_libjpeg.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp
index 75d8a7a32e..e0722e18dc 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -940,8 +940,10 @@ 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);
// All objects need to be instantiated before this setjmp call so that
// they will be cleaned up properly if an error occurs.
@@ -966,9 +968,6 @@ bool SkJPEGImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, int *width
return false;
}
- jpeg_decompress_struct* cinfo = imageIndex->cinfo();
- 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