about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2009-04-12 20:27:55 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2009-04-12 20:27:55 +0000
commitdddc32f86335ed2c0cd1211c3440922dbbd04661 (patch)
treed564b3aa5dacae0618880b441a81ce53369b5cfa
parentcc3802cd8231a9cefb8ad926ce99cc44262dfea6 (diff)
downloadnetpbm-mirror-dddc32f86335ed2c0cd1211c3440922dbbd04661.tar.gz
netpbm-mirror-dddc32f86335ed2c0cd1211c3440922dbbd04661.tar.xz
netpbm-mirror-dddc32f86335ed2c0cd1211c3440922dbbd04661.zip
Fix bytes per sample
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@880 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--doc/HISTORY2
-rw-r--r--generator/pamstereogram.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index f8612760..0b72d76c 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -13,6 +13,8 @@ not yet  BJH  Release 10.47.00
               pamstereogram: fix tuple type in output file (and crash
               with -verbose) with -patfile .
 
+              pamstereogram: fix uninitialized bytes per sample value.
+
               Fix: remove inclusion of pm_c_util.h from sshopt.h, which is
               an exported interface header file, whereas pm_c_util.h is not.
 
diff --git a/generator/pamstereogram.c b/generator/pamstereogram.c
index cd56de99..0ce63853 100644
--- a/generator/pamstereogram.c
+++ b/generator/pamstereogram.c
@@ -505,7 +505,6 @@ createoutputGenerator(struct cmdlineInfo const cmdline,
 
     outGenP->pam.size   = sizeof(struct pam);
     outGenP->pam.len    = PAM_STRUCT_SIZE(tuple_type);
-    outGenP->pam.bytes_per_sample = pnm_bytespersample(outGenP->pam.maxval);
     outGenP->pam.file   = stdout;
     outGenP->pam.height = inPamP->height + 3 * abs(cmdline.guidesize);
         /* Allow room for guides. */
@@ -521,6 +520,8 @@ createoutputGenerator(struct cmdlineInfo const cmdline,
         initRandomColor(outGenP, inPamP, cmdline);
     }
 
+    outGenP->pam.bytes_per_sample = pnm_bytespersample(outGenP->pam.maxval);
+
     *outputGeneratorPP = outGenP;
 }