From 6b39f70d4251512a5d3d91363adc3d019cc78123 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Tue, 11 Jan 2022 02:21:14 +0000 Subject: 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 --- converter/ppm/picttoppm.c | 4 ++-- doc/HISTORY | 3 +++ 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). -- cgit 1.4.1