about summary refs log tree commit diff
path: root/other/pamstack.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-08-05 22:56:06 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-08-05 22:56:06 +0000
commitafa13983a4b50d67a45f4793c51eae837fb0fdd4 (patch)
tree9fb4fc47f71a08952edce1a33c59881ab4bc62c9 /other/pamstack.c
parente3b6993ea733d50b7a05fadb9d6ef2f6a07ad3d7 (diff)
downloadnetpbm-mirror-afa13983a4b50d67a45f4793c51eae837fb0fdd4.tar.gz
netpbm-mirror-afa13983a4b50d67a45f4793c51eae837fb0fdd4.tar.xz
netpbm-mirror-afa13983a4b50d67a45f4793c51eae837fb0fdd4.zip
Release 11.03.02
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@4574 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'other/pamstack.c')
-rw-r--r--other/pamstack.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/other/pamstack.c b/other/pamstack.c
index 3f974a3a..285e02c0 100644
--- a/other/pamstack.c
+++ b/other/pamstack.c
@@ -13,6 +13,7 @@
 -----------------------------------------------------------------------------*/
 
 #include <string.h>
+#include <assert.h>
 
 #include "pm_c_util.h"
 #include "mallocvar.h"
@@ -236,8 +237,10 @@ processOneImageInAllStreams(unsigned int       const nInput,
         if (inpam[inputSeq].maxval != inpam[0].maxval)
             allImagesSameMaxval = false;
 
+        assert(PAM_OVERALL_MAXVAL <= UINT_MAX-1);
+
         maxvalLcm = pm_lcm(maxvalLcm + 1, inpam[inputSeq].maxval + 1, 1,
-                           PAM_OVERALL_MAXVAL) - 1;
+                           PAM_OVERALL_MAXVAL + 1) - 1;
 
         outputDepth += inpam[inputSeq].depth;
     }