A patch that solves this issue:
pipe@vitamin:~/src/imagemagick-6.3.7.9.dfsg1$ diff -u coders/orig/pnm.c coders/pnm.c --- coders/orig/pnm.c 2007-12-08 01:13:40.000000000 +0100 +++ coders/pnm.c 2009-03-24 21:54:47.000000000 +0100 @@ -417,7 +417,7 @@ ThrowReaderException(CorruptImageError,"NegativeOrZeroImageSize"); if (max_value >= 65536) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); - for (image->depth=1; (1UL << image->depth) < max_value; image->depth++); + for (image->depth=1; (1UL << image->depth) <= max_value; image->depth++); scale=(Quantum *) NULL; if (image->storage_class == PseudoClass) if (AllocateImageColormap(image,image->colors) == MagickFalse)
A patch that solves this issue:
pipe@vitamin: ~/src/imagemagi ck-6.3. 7.9.dfsg1$ diff -u coders/orig/pnm.c coders/pnm.c
ThrowReaderExce ption(CorruptIm ageError, "NegativeOrZero ImageSize" );
ThrowReaderExce ption(CorruptIm ageError, "ImproperImageH eader") ; >storage_ class == PseudoClass) olormap( image,image- >colors) == MagickFalse)
--- coders/orig/pnm.c 2007-12-08 01:13:40.000000000 +0100
+++ coders/pnm.c 2009-03-24 21:54:47.000000000 +0100
@@ -417,7 +417,7 @@
if (max_value >= 65536)
- for (image->depth=1; (1UL << image->depth) < max_value; image->depth++);
+ for (image->depth=1; (1UL << image->depth) <= max_value; image->depth++);
scale=(Quantum *) NULL;
if (image-
if (AllocateImageC