Index: src/codec/SkCodec_libpng.cpp |
diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp |
index 699ab398d3a36df70cfbbb1c24c96886047d7f3c..7f9aeaa0913a4028f0a1139f832b5537e194730d 100644 |
--- a/src/codec/SkCodec_libpng.cpp |
+++ b/src/codec/SkCodec_libpng.cpp |
@@ -576,18 +576,14 @@ SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void* |
// scanline decoding, but we could do it here. Alternatively, we could do |
// it as we go, instead of in post-processing like SkPNGImageDecoder. |
- this->finish(); |
- return kSuccess; |
-} |
- |
-void SkPngCodec::finish() { |
if (setjmp(png_jmpbuf(fPng_ptr))) { |
// We've already read all the scanlines. This is a success. |
- return; |
+ return kSuccess; |
} |
- // FIXME: Is this necessary? |
- /* read rest of file, and get additional chunks in info_ptr - REQUIRED */ |
+ |
+ // read rest of file, and get additional comment and time chunks in info_ptr |
png_read_end(fPng_ptr, fInfo_ptr); |
+ return kSuccess; |
} |
class SkPngScanlineDecoder : public SkScanlineDecoder { |
@@ -601,10 +597,6 @@ public: |
fSrcRow = static_cast<uint8_t*>(fStorage.get()); |
} |
- ~SkPngScanlineDecoder() { |
- fCodec->finish(); |
- } |
- |
SkCodec::Result onGetScanlines(void* dst, int count, size_t rowBytes) override { |
if (setjmp(png_jmpbuf(fCodec->fPng_ptr))) { |
SkCodecPrintf("setjmp long jump!\n"); |
@@ -662,10 +654,6 @@ public: |
fGarbageRowPtr = static_cast<uint8_t*>(fGarbageRow.get()); |
} |
- ~SkPngInterlacedScanlineDecoder() { |
- fCodec->finish(); |
- } |
- |
SkCodec::Result onGetScanlines(void* dst, int count, size_t dstRowBytes) override { |
//rewind stream if have previously called onGetScanlines, |
//since we need entire progressive image to get scanlines |