about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2015-03-03 03:24:17 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2015-03-03 03:24:17 +0000
commit4842d1d08807b4e85605a559abc65e9d52575bb1 (patch)
treef2c2d8773659610ee247c3bdaa270375f002b9a0
parenta1fe79bd9298d0a80be84e8a7b6c977a4ff35c24 (diff)
downloadnetpbm-mirror-4842d1d08807b4e85605a559abc65e9d52575bb1.tar.gz
netpbm-mirror-4842d1d08807b4e85605a559abc65e9d52575bb1.tar.xz
netpbm-mirror-4842d1d08807b4e85605a559abc65e9d52575bb1.zip
Fix used before set bug
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2413 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/cameratopam/camera.c8
-rw-r--r--doc/HISTORY3
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