about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-12-16 19:08:51 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-12-16 19:08:51 +0000
commite93b99570398f2b27058eb38e47c8ef57e74bd0d (patch)
treecc8296f6465e672f00eb86a5885138611d16cbb6
parentb6a6b95b043abc251dec304dc0beedd8e904983f (diff)
downloadnetpbm-mirror-e93b99570398f2b27058eb38e47c8ef57e74bd0d.tar.gz
netpbm-mirror-e93b99570398f2b27058eb38e47c8ef57e74bd0d.tar.xz
netpbm-mirror-e93b99570398f2b27058eb38e47c8ef57e74bd0d.zip
Fix failure to fail with insufficient -width or -height
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4804 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-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);