about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-01-11 02:21:14 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-01-11 02:21:14 +0000
commit6b39f70d4251512a5d3d91363adc3d019cc78123 (patch)
tree358c840e117090ff1522aacc61b6886dff00bad7
parent821558dee85b5cf87087c6feb32c153d36f55a2c (diff)
downloadnetpbm-mirror-6b39f70d4251512a5d3d91363adc3d019cc78123.tar.gz
netpbm-mirror-6b39f70d4251512a5d3d91363adc3d019cc78123.tar.xz
netpbm-mirror-6b39f70d4251512a5d3d91363adc3d019cc78123.zip
Fix incorrect output for 32 bit per pixel image with only 3 planes
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4239 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/ppm/picttoppm.c4
-rw-r--r--doc/HISTORY3
2 files changed, 5 insertions, 2 deletions
diff --git a/converter/ppm/picttoppm.c b/converter/ppm/picttoppm.c
index 231479c5..cd36bb50 100644
--- a/converter/ppm/picttoppm.c
+++ b/converter/ppm/picttoppm.c
@@ -1522,7 +1522,7 @@ doDiffSize(struct Rect       const srcRect,
         }
     } break;
     case 32: {
-        unsigned int const planeSize = srcwid / 4;
+        unsigned int const planeSize = rectwidth(&srcRect);
         unsigned int row;
 
         for (row = 0; row < rectheight(&srcRect); ++row) {
@@ -1659,7 +1659,7 @@ doSameSize32bpp(transfer_func           trf,
                 struct RgbPlanes  const dst,
                 unsigned int      const dstwid) {
 
-    unsigned int const planeSize = srcwid / 4;
+    unsigned int const planeSize = xsize;
 
     unsigned int rowNumber;
 
diff --git a/doc/HISTORY b/doc/HISTORY
index 0d467405..babf2df0 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -6,6 +6,9 @@ CHANGE HISTORY
 
 not yet  BJH  Release 10.98.00
 
+              picttoppm: Fix incorrect output for 32 bit per pixel images
+              that have only 3 planes.  Broken in Netpbm 10.34 (June 2006).
+
               pamendian: fix bogus "sample exceeds maxval" failure.
               Introduced in Netpbm 10.66 (March 2014).