File GraphicsMagick-CVE-2014-9834.patch of Package GraphicsMagick.7782
Index: GraphicsMagick-1.3.20/coders/pict.c
===================================================================
--- GraphicsMagick-1.3.20.orig/coders/pict.c 2016-06-22 10:14:07.685820394 +0200
+++ GraphicsMagick-1.3.20/coders/pict.c 2016-06-22 10:14:13.721918998 +0200
@@ -462,7 +462,9 @@ static unsigned char *DecodeImage(const
return((unsigned char *) NULL);
allocated_pixels=image->rows*row_bytes;
(void) memset(pixels,0,allocated_pixels);
- scanline=MagickAllocateMemory(unsigned char *,row_bytes);
+ if (row_bytes > ULONG_MAX / 2)
+ return((unsigned char *) NULL);
+ scanline=MagickAllocateMemory(unsigned char *,2*row_bytes);
if (scanline == (unsigned char *) NULL)
return((unsigned char *) NULL);
if (bytes_per_line < 8)