From 4842d1d08807b4e85605a559abc65e9d52575bb1 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Tue, 3 Mar 2015 03:24:17 +0000 Subject: Fix used before set bug git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2413 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/other/cameratopam/camera.c | 8 +++++--- doc/HISTORY | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/converter/other/cameratopam/camera.c b/converter/other/cameratopam/camera.c index 14d208e3..d318e379 100644 --- a/converter/other/cameratopam/camera.c +++ b/converter/other/cameratopam/camera.c @@ -15,6 +15,7 @@ #include "pm_config.h" #include "pm.h" #include "mallocvar.h" +#include "pm_c_util.h" #include "global_variables.h" #include "cameratopam.h" @@ -699,11 +700,12 @@ kodak_radc_load_raw(Image const image) { init_decoder(); getbits(ifp, -1); - for (i = 0; i < 3; ++i) { + for (i = 0; i < ARRAY_SIZE(buf); ++i) { unsigned int j; - for (j = 0; j < 3; ++j) { + for (j = 0; j < ARRAY_SIZE(buf[0]); ++j) { unsigned int k; - buf[i][j][k] = 2048; + for (k = 0; k < ARRAY_SIZE(buf[0][0]); ++k) + buf[i][j][k] = 2048; } } for (row=0; row < height; row+=4) { diff --git a/doc/HISTORY b/doc/HISTORY index 3256d5fb..818b6ac4 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -22,6 +22,9 @@ not yet BJH Release 10.70.00 nearly always. Always broken (These options were new in Netpbm 10.32 (February 2006)). + cameratopam: fix bug: variable used before set; unknown impact. + Introduced in Netpbm 10.66 (March 2014). + On Windows, don't leave temporary files around (previous code did so because unlink of an open file fails in Windows; new code deletes temporary files via atexit). Thanks -- cgit 1.4.1