about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-03-31 19:04:31 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-03-31 19:04:31 +0000
commitbe242df7305436f0cf192b70fa7c21c34e8cffba (patch)
tree12c3a7c23114ec239506c326adb02e6381b8d126
parent34c1d566061e92581adf53baa40dc78d2b96be3a (diff)
downloadnetpbm-mirror-be242df7305436f0cf192b70fa7c21c34e8cffba.tar.gz
netpbm-mirror-be242df7305436f0cf192b70fa7c21c34e8cffba.tar.xz
netpbm-mirror-be242df7305436f0cf192b70fa7c21c34e8cffba.zip
Fix bug: crash on non-palette image
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1456 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/ppm/ppmtobmp.c4
-rw-r--r--doc/HISTORY5
2 files changed, 6 insertions, 3 deletions
diff --git a/converter/ppm/ppmtobmp.c b/converter/ppm/ppmtobmp.c
index d12e5788..684b3f22 100644
--- a/converter/ppm/ppmtobmp.c
+++ b/converter/ppm/ppmtobmp.c
@@ -505,7 +505,7 @@ bmpEncode(FILE *           const ifP,
 
     if (nbyte != (BMPlenfileheader(class)
                   + BMPleninfoheader(class)
-                  + BMPlencolormap(class, bpp, -1)))
+                  + BMPlencolormap(class, bpp, 0)))
         pm_error(er_internal, "BmpEncode 1");
 
     nbyte += BMPwritebits(ifP, x, y, colortype, bpp, pixels, maxval,
@@ -564,7 +564,7 @@ bmpEncodePbm(FILE *           const ifP,
 
     if (nbyte != (BMPlenfileheader(class)
                   + BMPleninfoheader(class)
-                  + BMPlencolormap(class, 1, -1)))
+                  + BMPlencolormap(class, 1, 0)))
         pm_error(er_internal, "bmpEncodePBM 1");
    
     for (row = 0; row < rows; ++row){
diff --git a/doc/HISTORY b/doc/HISTORY
index f2401ce2..042a5bac 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -8,7 +8,10 @@ not yet  BJH  Release 10.55.00
 
               libnetpbm: pm_system(): fix bug - program always takes
               Standard Input from invoker's Standard Input when you don't
-              supply a Standard Output accepter.
+              supply a Standard Output accepter.  Broken in 10.40.00.
+
+              ppmtopbm: fix bug: crash ("internal error") on image without
+              palette (e.g. black and white).  Broken in 10.54.
 
 11.03.30 BJH  Release 10.54.00