]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 28 Oct 2014 13:12:17 +0000 (13:12 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 28 Oct 2014 13:12:17 +0000 (13:12 +0000)
coders/pnm.c

index ce0e559687c48c9717b41b477a16724bae4b93bd..35b40efc6fb144c2eb068961dc4f0baff55a199e 100644 (file)
@@ -410,7 +410,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
       }
     if ((image->columns == 0) || (image->rows == 0))
       ThrowReaderException(CorruptImageError,"NegativeOrZeroImageSize");
-    if (max_value > 4294967295)
+    if ((max_value == 0) || (max_value > 4294967295))
       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
     for (depth=1; GetQuantumRange(depth) < max_value; depth++) ;
     image->depth=depth;