Index: src/codec/SkJpegCodec.cpp |
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp |
index eb059545bf0359fcd5c6a96f396a1ee25d36568f..0413f79a3c358466f4542d5812461adab209104e 100644 |
--- a/src/codec/SkJpegCodec.cpp |
+++ b/src/codec/SkJpegCodec.cpp |
@@ -339,11 +339,6 @@ |
} |
SkASSERT(nullptr != decoderMgr); |
fDecoderMgr.reset(decoderMgr); |
- |
- fSwizzler.reset(nullptr); |
- fSrcRow = nullptr; |
- fStorage.reset(); |
- |
return true; |
} |
@@ -593,6 +588,11 @@ |
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"); |