about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/HISTORY4
-rw-r--r--editor/pnmpad.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 9e3a8bca..2328f6d2 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -14,6 +14,10 @@ not yet  BJH  Release 11.05.00
               libnetpbm.  (Was fixed in 10.47.08 in November 2010, but only in
               the 10.47 series).
 
+              pnmpad: fix behavior with -left, -right, and -width together or
+              -top, -bottom, -height together: ignores -width where it should
+              fail.  Broken in Netpbm 10.72 (September 2015).
+
               pamtosvg: fix "zero determinant" failure.  Introduced in
               Netpbm 11.04 (September 2023).
 
diff --git a/editor/pnmpad.c b/editor/pnmpad.c
index da7eed2b..ae1abc1f 100644
--- a/editor/pnmpad.c
+++ b/editor/pnmpad.c
@@ -381,8 +381,8 @@ computePadSizeBeforeMult(unsigned int   const unpaddedSize,
 -----------------------------------------------------------------------------*/
     if (sizeSpec) {
         if (begPadSpec && endPadSpec) {
-            if (begPadReq + unpaddedSize + endPadReq < unpaddedSize) {
-                pm_error("Beginning adding (%u), and end "
+            if (begPadReq + unpaddedSize + endPadReq < sizeReq) {
+                pm_error("Beginning padding (%u), and end "
                          "padding (%u) are insufficient to bring the "
                          "image size of %u up to %u.",
                          begPadReq, endPadReq, unpaddedSize, sizeReq);