From 074b331756e2dcd520e821db3fd7789926b9ccd9 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Thu, 27 Jan 2022 02:36:15 +0000 Subject: Release 10.97.03 git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@4263 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- analyzer/pgmtexture.c | 3 +++ converter/ppm/ppmtoapplevol.c | 6 +++++- doc/HISTORY | 16 ++++++++++++++++ editor/specialty/pgmabel.c | 11 +++++------ version.mk | 2 +- 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/analyzer/pgmtexture.c b/analyzer/pgmtexture.c index c69643e7..ea0b6210 100644 --- a/analyzer/pgmtexture.c +++ b/analyzer/pgmtexture.c @@ -51,6 +51,7 @@ vector(unsigned int const nl, unsigned int const nh) { float * v; + unsigned int i; assert(nh >= nl); @@ -59,6 +60,8 @@ vector(unsigned int const nl, if (v == NULL) pm_error("Unable to allocate memory for a vector."); + for(i = 0; i < nh - nl +1; ++i) + v[i] = 0; return v - nl; } diff --git a/converter/ppm/ppmtoapplevol.c b/converter/ppm/ppmtoapplevol.c index e1c7f2dc..eb4b6b2a 100644 --- a/converter/ppm/ppmtoapplevol.c +++ b/converter/ppm/ppmtoapplevol.c @@ -68,6 +68,10 @@ main (int argc, const char * argv[]) { if (rows != 12) pm_error("Input image must be 12 rows tall. Yours is %u", rows); + if (cols > 255) + pm_error("Input image must not be more than 255 columns wide." + " Yours is %u", cols); + writeHeader(cols, stdout); pixelrow = ppm_allocrow(cols); @@ -75,7 +79,7 @@ main (int argc, const char * argv[]) { for (row = 0; row < rows; row++) { unsigned int col; - ppm_readppmrow(stdin, pixelrow, cols, maxval, format); + ppm_readppmrow(ifP, pixelrow, cols, maxval, format); for (col = 0; col < cols; ++col) { unsigned int const maxval15Value = diff --git a/doc/HISTORY b/doc/HISTORY index d6d9e7df..ef803b58 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -4,6 +4,22 @@ Netpbm. CHANGE HISTORY -------------- +not yet BJH Release 10.97.03 + + ppmtoapplevol: Fix bug: reads from Standard Input even when you + specify the input file argument. Always broken. (ppmtoapplevol + was new in Netpbm 10.54 (March 2011). + + ppmtoapplevol: Fix bug: produces garbage with input image wider + than 255. Always broken. (ppmtoapplevol was new in Netpbm + 10.54 (March 2011). + + pgmtexture: Fix incorrect output. Always broken. (Program was + added in primordial Netpbm in 1991). + + pgmabel: Fix incorrect output. Always broken. (Program was + new in Netpbm 10.3 (July 2002). + 22.01.11 BJH Release 10.97.02 ppmtoilbm: Fix wild memory references and hangs with -map . diff --git a/editor/specialty/pgmabel.c b/editor/specialty/pgmabel.c index aa748f88..5badfd19 100644 --- a/editor/specialty/pgmabel.c +++ b/editor/specialty/pgmabel.c @@ -100,20 +100,19 @@ abel ( float *y, int N, double *adl) { register int n; double *rho, *rhop; /* results and new index */ - float *yp; /* new indizes for the y-array */ MALLOCARRAY(rho, N); if( !rho ) pm_error( "out of memory" ); + for (n=0 ; n 2) rhop[n-1] = (rho[n-2]+rho[n-1]+rho[n])/3.0; stabilization*/ + rhop[n] = MAX(0, (y[n] - Sum(n,rho,N,adl))/(adl[n*N+n])); + /* Clip to 0 for error correction ! */ } for (n=0 ; n