about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/HISTORY6
-rw-r--r--other/pamstack.c5
-rw-r--r--version.mk2
3 files changed, 12 insertions, 1 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 0c2ce263..be66a851 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,12 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+23.08.05 BJH  Release 11.02.01
+
+              pamstack: Fail gracefully when total number of planes is too
+              large for unsigned integer.  Always broken (Pamstack was new in
+              Netpbm 10.0 (June 2002).
+
 23.03.25 BJH  Release 11.02.00
 
               jpegtopnm: Add -traceexif
diff --git a/other/pamstack.c b/other/pamstack.c
index 308852c8..9e56845f 100644
--- a/other/pamstack.c
+++ b/other/pamstack.c
@@ -186,6 +186,11 @@ processOneImageInAllStreams(unsigned int const nInput,
                 pm_error("Image no. %u does not have the same maxval as "
                          "Image 0.", inputSeq);
         }
+        if (inpam[inputSeq].depth > UINT_MAX - outputDepth)
+            pm_error("Total number of planes is too large to compute "
+                     "(at least %u plus %u)",
+                     outputDepth, inpam[inputSeq].depth);
+
         outputDepth += inpam[inputSeq].depth;
     }
 
diff --git a/version.mk b/version.mk
index d579dc15..bdeb8e90 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 11
 NETPBM_MINOR_RELEASE = 2
-NETPBM_POINT_RELEASE = 0
+NETPBM_POINT_RELEASE = 1