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

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 1370323004: Stop calling jpeg_finish_decompress() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Adding comment Created 5 years, 2 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/codec/SkJpegCodec.h ('k') | src/codec/SkJpegUtility_codec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkJpegCodec.cpp
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index b4c794c90623111d3835b0673d5ec88eb5c42d32..68a120eaa33f2e9597d705f69728efc168c55f59 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -355,11 +355,6 @@ SkCodec::Result SkJpegCodec::onGetPixels(const SkImageInfo& dstInfo,
SkSwizzler::Fill(dstRow, dstInfo, dstRowBytes, dstHeight - y,
SK_ColorBLACK, nullptr, options.fZeroInitialized);
- // Prevent libjpeg from failing on incomplete decode
- dinfo->output_scanline = dstHeight;
-
- // Finish the decode and indicate that the input was incomplete.
- jpeg_finish_decompress(dinfo);
return fDecoderMgr->returnFailure("Incomplete image data", kIncompleteInput);
}
@@ -371,7 +366,6 @@ SkCodec::Result SkJpegCodec::onGetPixels(const SkImageInfo& dstInfo,
// Move to the next row
dstRow = SkTAddOffset<JSAMPLE>(dstRow, dstRowBytes);
}
- jpeg_finish_decompress(dinfo);
return kSuccess;
}
@@ -447,20 +441,6 @@ SkCodec::Result SkJpegCodec::onStartScanlineDecode(const SkImageInfo& dstInfo,
return kSuccess;
}
-SkJpegCodec::~SkJpegCodec() {
- // FIXME: This probably does not need to be called after a full decode
- // FIXME: Is it safe to call when it doesn't need to be called?
- if (setjmp(fDecoderMgr->getJmpBuf())) {
- SkCodecPrintf("setjmp: Error in libjpeg finish_decompress\n");
- return;
- }
-
- // We may not have decoded the entire image. Prevent libjpeg-turbo from failing on a
- // partial decode.
- fDecoderMgr->dinfo()->output_scanline = this->getInfo().height();
- jpeg_finish_decompress(fDecoderMgr->dinfo());
-}
-
SkCodec::Result SkJpegCodec::onGetScanlines(void* dst, int count, size_t rowBytes) {
// Set the jump location for libjpeg errors
if (setjmp(fDecoderMgr->getJmpBuf())) {
« no previous file with comments | « src/codec/SkJpegCodec.h ('k') | src/codec/SkJpegUtility_codec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698