From e93b99570398f2b27058eb38e47c8ef57e74bd0d Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 16 Dec 2023 19:08:51 +0000 Subject: 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 --- doc/HISTORY | 4 ++++ editor/pnmpad.c | 4 ++-- 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); -- cgit 1.4.1