about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/HISTORY10
-rw-r--r--editor/pnmnorm.c2
2 files changed, 8 insertions, 4 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 5b8a7ab2..a68dab03 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -6,10 +6,14 @@ CHANGE HISTORY
 
 not yet  BJH  Release 10.92.00
 
-              pbmtext: fix double-free crash with -font .  Introduced in
+              pnmnorm: Fix bug: output too dark when -bpercent and -wpercent
+              indicate overlapping values.  Broken since Netpbm 10.43 (June
+              2008).
+
+              pbmtext: Fix double-free crash with -font .  Introduced in
               Netpbm 10.91 (June 2020).
 
-              pgmtopbm: add -randomseed.
+              pgmtopbm: Add -randomseed.
 
               pcdovtoppm: Fix some garbage from the conversion from csh to sh
               in Netpbm 9.12 (March 2001) in conversion from csh arrays that
@@ -23,7 +27,7 @@ not yet  BJH  Release 10.92.00
 
               pamstereogram: Add -tileable.  Thanks Scott Pakin.
 
-              pcdovtoppm: implement -version, -plain, and -quiet.
+              pcdovtoppm: Implement -version, -plain, and -quiet.
 
               pcdovtoppm: more secure temporary file handling.
 
diff --git a/editor/pnmnorm.c b/editor/pnmnorm.c
index e0fe0e35..20d7eb04 100644
--- a/editor/pnmnorm.c
+++ b/editor/pnmnorm.c
@@ -487,7 +487,7 @@ disOverlap(xelval   const reqBvalue,
             }
         } else {
             /* Both ends are free; use the point halfway between them. */
-            xelval const midPoint = (reqWvalue + reqBvalue + maxval/2)/2;
+            xelval const midPoint = (reqWvalue + reqBvalue)/2;
             *nonOlapBvalueP = MIN(midPoint, maxval-1);
             *nonOlapWvalueP = *nonOlapBvalueP + 1;
         }