A patch that solves this issue:

p...@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)


** Attachment added: "Solves the bug with PNM images with maxval 256"
   http://launchpadlibrarian.net/24318346/pnm_fix.patch

-- 
ImageMagick interprets PGM header incorrectly
https://bugs.launchpad.net/bugs/346474
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to