about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/HISTORY2
-rw-r--r--other/pamarith.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 9f4bb23a..fc86e3a6 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -8,6 +8,8 @@ not yet  BJH  Release 10.57.00
 
               pnmnorm: add -midvalue, -middle .
 
+              pamarith: fix wrong result with -multiply.  Broken in 10.41.
+
 11.09.28 BJH  Release 10.56.00
 
               Add pamexec.  Thanks Michael Pot <fmw@actrix.co.nz>.
diff --git a/other/pamarith.c b/other/pamarith.c
index f1e8d7cb..a53029da 100644
--- a/other/pamarith.c
+++ b/other/pamarith.c
@@ -541,7 +541,7 @@ sampleProduct(sample       const operands[],
     double product;
 
     for (i = 0, product = 1.0; i < operandCt; ++i) {
-        product *= ((double)operands[0]/maxval);
+        product *= ((double)operands[i]/maxval);
     }
     return (sample)(product * maxval + 0.5);
 }