--- ImageMagick-6.0.7/coders/pnm.c.pnm 2005-04-26 10:05:25.354287000 -0400 +++ ImageMagick-6.0.7/coders/pnm.c 2005-04-26 10:06:02.330272000 -0400 @@ -320,7 +320,7 @@ */ if (AllocateImageColormap(image,image->colors) == MagickFalse) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); - if (format == '7') + if ((format == '7') && (image->colors == 256)) { /* Initialize 332 colormap.