diff options
author | mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-24 16:20:05 +0000 |
---|---|---|
committer | mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-24 16:20:05 +0000 |
commit | 8d725b25a6287e49e2b0cb2965871186e716eded (patch) | |
tree | cae64f22378dc66a3443dec170209776f04b56e0 /src | |
parent | 147adb10f7f80ae721879e08474fd575e719487c (diff) |
all in the gyp
BUG=
R=caryclark@google.com
Review URL: https://codereview.chromium.org/19726012
git-svn-id: http://skia.googlecode.com/svn/trunk@10315 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/images/SkImageDecoder_libjpeg.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp index 0a016e5cd2..e0783c9fb5 100644 --- a/src/images/SkImageDecoder_libjpeg.cpp +++ b/src/images/SkImageDecoder_libjpeg.cpp @@ -917,11 +917,6 @@ protected: SkAutoTime atm("JPEG Encode"); #endif - const WriteScanline writer = ChooseWriter(bm); - if (NULL == writer) { - return false; - } - SkAutoLockPixels alp(bm); if (NULL == bm.getPixels()) { return false; @@ -940,8 +935,14 @@ protected: if (setjmp(sk_err.fJmpBuf)) { return false; } - jpeg_create_compress(&cinfo); + // Keep after setjmp or mark volatile. + const WriteScanline writer = ChooseWriter(bm); + if (NULL == writer) { + return false; + } + + jpeg_create_compress(&cinfo); cinfo.dest = &sk_wstream; cinfo.image_width = bm.width(); cinfo.image_height = bm.height(); |