Index: src/codec/SkCodec.cpp |
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp |
index f1e69be59d065acf73c28e059355345d4073da73..04ee7c6a4383736d11f738a7646a49fc9cd8b07c 100644 |
--- a/src/codec/SkCodec.cpp |
+++ b/src/codec/SkCodec.cpp |
@@ -76,30 +76,19 @@ SkCodec* SkCodec::NewFromStream(SkStream* stream, |
} |
} |
- SkAutoTDelete<SkCodec> codec(nullptr); |
// PNG is special, since we want to be able to supply an SkPngChunkReader. |
// But this code follows the same pattern as the loop. |
if (SkPngCodec::IsPng(buffer, bytesRead)) { |
- codec.reset(SkPngCodec::NewFromStream(streamDeleter.detach(), chunkReader)); |
+ return SkPngCodec::NewFromStream(streamDeleter.detach(), chunkReader); |
} else { |
for (DecoderProc proc : gDecoderProcs) { |
if (proc.IsFormat(buffer, bytesRead)) { |
- codec.reset(proc.NewFromStream(streamDeleter.detach())); |
- break; |
+ return proc.NewFromStream(streamDeleter.detach()); |
} |
} |
} |
- // Set the max size at 128 megapixels (512 MB for kN32). |
- // This is about 4x smaller than a test image that takes a few minutes for |
- // dm to decode and draw. |
- const int32_t maxSize = 1 << 27; |
- if (codec && codec->getInfo().width() * codec->getInfo().height() > maxSize) { |
- SkCodecPrintf("Error: Image size too large, cannot decode.\n"); |
- return nullptr; |
- } else { |
- return codec.detach(); |
- } |
+ return nullptr; |
} |
SkCodec* SkCodec::NewFromData(SkData* data, SkPngChunkReader* reader) { |