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 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'converter/ppm/picttoppm.c') 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; -- cgit 1.4.1