File ImageMagick-CVE-2014-9805.patch of Package ImageMagick.8212

diff --git a/coders/pnm.c b/coders/pnm.c
index 03f5fe5..1d6817e 100644
--- a/coders/pnm.c
+++ b/coders/pnm.c
@@ -411,7 +411,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
       }
     if ((image->columns == 0) || (image->rows == 0))
       ThrowReaderException(CorruptImageError,"NegativeOrZeroImageSize");
-    if (max_value > 4294967295U)
+    if ((max_value == 0) || (max_value > 4294967295U))
       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
     for (depth=1; GetQuantumRange(depth) < max_value; depth++) ;
     image->depth=depth;