Blame SOURCES/ImageMagick-icon-mem.patch

b7c072
diff -up ImageMagick-6.7.8-9/coders/icon.c.icon-mem ImageMagick-6.7.8-9/coders/icon.c
b7c072
--- ImageMagick-6.7.8-9/coders/icon.c.icon-mem	2012-07-17 21:11:28.000000000 +0200
b7c072
+++ ImageMagick-6.7.8-9/coders/icon.c	2016-06-02 16:18:24.366200378 +0200
b7c072
@@ -277,6 +277,8 @@ static Image *ReadICONImage(const ImageI
b7c072
           Icon image encoded as a compressed PNG image.
b7c072
         */
b7c072
         length=icon_file.directory[i].size;
b7c072
+        if (~length < 16)
b7c072
+          ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
b7c072
         png=(unsigned char *) AcquireQuantumMemory(length+16,sizeof(*png));
b7c072
         if (png == (unsigned char *) NULL)
b7c072
           ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");