about summary refs log tree commit diff
path: root/converter/ppm/ppmtobmp.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-04-06 15:52:49 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-04-06 15:52:49 +0000
commit805d780d7b8808604f7f7ae42b78f39b2edbf106 (patch)
tree1f07c97d88d6715c0040d46c9314f3153fed1974 /converter/ppm/ppmtobmp.c
parent5c347cd98a0bffcf3a81498a5ab595377254da6d (diff)
downloadnetpbm-mirror-805d780d7b8808604f7f7ae42b78f39b2edbf106.tar.gz
netpbm-mirror-805d780d7b8808604f7f7ae42b78f39b2edbf106.tar.xz
netpbm-mirror-805d780d7b8808604f7f7ae42b78f39b2edbf106.zip
Fix more bugs with non-palette image due to special value of -1 for cmapsize changing to 0 in 10.54
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1468 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/ppm/ppmtobmp.c')
-rw-r--r--converter/ppm/ppmtobmp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/converter/ppm/ppmtobmp.c b/converter/ppm/ppmtobmp.c
index 684b3f22..7939b4d5 100644
--- a/converter/ppm/ppmtobmp.c
+++ b/converter/ppm/ppmtobmp.c
@@ -190,7 +190,7 @@ BMPwritefileheader(FILE *        const fp,
     PutByte(fp, 'M');
 
     /* cbSize */
-    PutLong(fp, BMPlenfile(class, bitcount, -1, x, y));
+    PutLong(fp, BMPlenfile(class, bitcount, 0, x, y));
     
     /* xHotSpot */
     PutShort(fp, 0);
@@ -199,7 +199,7 @@ BMPwritefileheader(FILE *        const fp,
     PutShort(fp, 0);
     
     /* offBits */
-    PutLong(fp, BMPoffbits(class, bitcount, -1));
+    PutLong(fp, BMPoffbits(class, bitcount, 0));
     
     return 14;
 }
@@ -510,7 +510,7 @@ bmpEncode(FILE *           const ifP,
 
     nbyte += BMPwritebits(ifP, x, y, colortype, bpp, pixels, maxval,
                           colorMapP->cht);
-    if (nbyte != BMPlenfile(class, bpp, -1, x, y))
+    if (nbyte != BMPlenfile(class, bpp, 0, x, y))
         pm_error(er_internal, "BmpEncode 2");
 }
 
@@ -581,7 +581,7 @@ bmpEncodePbm(FILE *           const ifP,
             nbyte += bytesWritten;
     }
 
-    if (nbyte != BMPlenfile(class, 1, -1, cols, rows))
+    if (nbyte != BMPlenfile(class, 1, 0, cols, rows))
         pm_error(er_internal, "bmpEncodePbm 2");
 }