about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/HISTORY4
-rw-r--r--editor/pamaddnoise.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 776b3af8..1f5d3c87 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -15,6 +15,10 @@ not yet  BJH  Release 10.93.00
               pamrith: fail if operand images have different depth and not
               depth 1.
 
+              pamaddnoise: fix bug: garbage output with -type impulse.  Always
+              broken (pamaddnoise's precursors pnmaddnoise was new to Netpbm
+              in Netpbm 10.29 (August 2005).
+
 20.09.26 BJH  Release 10.92.00
 
               pnmcrop: Make -margin effective with -blank-image=minimize.
diff --git a/editor/pamaddnoise.c b/editor/pamaddnoise.c
index 37d9fece..9144c341 100644
--- a/editor/pamaddnoise.c
+++ b/editor/pamaddnoise.c
@@ -97,6 +97,8 @@ impulse_noise(sample   const maxval,
         *newSampleP = 0;
     else if ( sap >= high_tol )
         *newSampleP = maxval;
+    else
+        *newSampleP = origSample;
 }