Index: src/codec/SkJpegCodec.cpp |
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp |
index 0413f79a3c358466f4542d5812461adab209104e..b78186359abc2a86378405bd69d1d9df802de2cd 100644 |
--- a/src/codec/SkJpegCodec.cpp |
+++ b/src/codec/SkJpegCodec.cpp |
@@ -263,6 +263,7 @@ SkJpegCodec::SkJpegCodec(int width, int height, const SkEncodedInfo& info, SkStr |
: INHERITED(width, height, info, stream, std::move(colorSpace), origin) |
, fDecoderMgr(decoderMgr) |
, fReadyState(decoderMgr->dinfo()->global_state) |
+ , fSrcRow(nullptr) |
, fSwizzlerSubset(SkIRect::MakeEmpty()) |
, fICCData(std::move(iccData)) |
{} |
@@ -339,6 +340,11 @@ bool SkJpegCodec::onRewind() { |
} |
SkASSERT(nullptr != decoderMgr); |
fDecoderMgr.reset(decoderMgr); |
+ |
+ fSwizzler.reset(nullptr); |
+ fSrcRow = nullptr; |
+ fStorage.reset(); |
+ |
return true; |
} |
@@ -588,11 +594,6 @@ SkCodec::Result SkJpegCodec::onStartScanlineDecode(const SkImageInfo& dstInfo, |
return kInvalidConversion; |
} |
- // Remove objects used for sampling. |
- fSwizzler.reset(nullptr); |
- fSrcRow = nullptr; |
- fStorage.reset(); |
- |
// Now, given valid output dimensions, we can start the decompress |
if (!jpeg_start_decompress(fDecoderMgr->dinfo())) { |
SkCodecPrintf("start decompress failed\n"); |