Index: src/codec/SkCodec_libpng.cpp |
diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp |
index 444e2ad87e0ae14a3bfd95746fd991f592c7ceca..c8d331db52bae2d4931e334b034b72d34135a49f 100644 |
--- a/src/codec/SkCodec_libpng.cpp |
+++ b/src/codec/SkCodec_libpng.cpp |
@@ -514,6 +514,12 @@ bool SkPngCodec::handleRewind() { |
SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void* dst, |
size_t rowBytes, const Options& options, |
SkPMColor ctable[], int* ctableCount) { |
+ // Do not allow a regular decode if the caller has asked for a scanline decoder |
+ if (NULL != this->scanlineDecoder()) { |
+ SkCodecPrintf("cannot getPixels() if a scanline decoder has been created\n"); |
+ return kInvalidInput; |
+ } |
+ |
if (!this->handleRewind()) { |
return kCouldNotRewind; |
} |
@@ -734,7 +740,7 @@ private: |
- |
+ |
typedef SkScanlineDecoder INHERITED; |
}; |