-2017-06-10 7.0.6-1 Glenn Randers-Pehrson <glennrp@image...>
+2017-07-02 7.0.6-1 Glenn Randers-Pehrson <glennrp@image...>
+ * Reject PNG file that is too small (under 60 bytes) to contain
+ a valid image
+
+2017-06-22 7.0.6-1 Glenn Randers-Pehrson <glennrp@image...>
* Stop a memory leak in read_user_chunk_callback() (reference
https://github.com/ImageMagick/ImageMagick/issues/517).
if (count < 8 || memcmp(magic_number,"\211PNG\r\n\032\n",8) != 0)
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ /*
+ Verify that file size large enough to contain a PNG datastream
+ if using a seekable blob
+ */
+ if (IsBlobSeekable(image) && GetBlobSize(image) < 61)
+ ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
+
/*
Allocate a MngInfo structure.
*/