File GraphicsMagick-CVE-2014-9809.patch of Package GraphicsMagick.7893

Index: GraphicsMagick-1.3.25/coders/xwd.c
===================================================================
--- GraphicsMagick-1.3.25.orig/coders/xwd.c	2016-11-28 13:39:12.312865798 +0100
+++ GraphicsMagick-1.3.25/coders/xwd.c	2016-11-28 13:41:27.039097932 +0100
@@ -363,6 +363,8 @@ static Image *ReadXWDImage(const ImageIn
       ximage->bytes_per_line < 0 ||
       ximage->bits_per_pixel < 0)
     ThrowXWDReaderException(CorruptImageError,ImproperImageHeader,image);
+  if ((ximage->width > 65535) || (ximage->height > 65535))
+    ThrowReaderException(CorruptImageError,ImproperImageHeader,image);
   /* Guard against buffer overflow in libX11. */
   if (ximage->bits_per_pixel > 32 || ximage->bitmap_unit > 32)
     ThrowXWDReaderException(CorruptImageError,ImproperImageHeader,image);
openSUSE Build Service is sponsored by