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

Index: GraphicsMagick-1.3.21/coders/pnm.c
===================================================================
--- GraphicsMagick-1.3.21.orig/coders/pnm.c	2016-08-04 21:10:54.606410204 +0200
+++ GraphicsMagick-1.3.21/coders/pnm.c	2016-08-04 21:11:36.635120175 +0200
@@ -538,6 +538,8 @@ static Image *ReadPNMImage(const ImageIn
       if ((max_value == 0) || (max_value > 4294967295U))
         ThrowReaderException(CorruptImageError,ImproperImageHeader,image);
 
+      if (max_value == 0)
+        ThrowReaderException(CorruptImageError,ImproperImageHeader,image);
       bits_per_sample=0;
       if (max_value <= 1)
 	bits_per_sample=1;
openSUSE Build Service is sponsored by