File GraphicsMagick-CVE-2017-8355.patch of Package GraphicsMagick.7782
Index: GraphicsMagick-1.2.5/coders/mtv.c
===================================================================
--- GraphicsMagick-1.2.5.orig/coders/mtv.c 2017-05-15 15:31:18.299430346 +0200
+++ GraphicsMagick-1.2.5/coders/mtv.c 2017-05-15 15:32:25.024588099 +0200
@@ -154,7 +154,10 @@ static Image *ReadMTVImage(const ImageIn
for (y=0; y < (long) image->rows; y++)
{
if (ReadBlob(image,row_size,pixels) != row_size)
+ {
+ MagickFreeMemory(pixels);
ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image);
+ }
p=pixels;
q=SetImagePixels(image,0,y,image->columns,1);
if (q == (PixelPacket *) NULL)