about summary refs log tree commit diff
path: root/urt
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-10-20 21:12:44 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-10-20 21:12:44 +0000
commitaa32dffb962d0159f91f4374a676c66ef63a2fa8 (patch)
tree63ca4df5e4ee43899c8283c66dd9f16f1480b3c9 /urt
parent2fb0317678ee7db8c2fcba3e33c9cb9a6ca4a3b4 (diff)
downloadnetpbm-mirror-aa32dffb962d0159f91f4374a676c66ef63a2fa8.tar.gz
netpbm-mirror-aa32dffb962d0159f91f4374a676c66ef63a2fa8.tar.xz
netpbm-mirror-aa32dffb962d0159f91f4374a676c66ef63a2fa8.zip
Fix crash introduced by prior commit
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4770 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'urt')
-rw-r--r--urt/Runput.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/urt/Runput.c b/urt/Runput.c
index 83250814..d4281bb9 100644
--- a/urt/Runput.c
+++ b/urt/Runput.c
@@ -203,7 +203,7 @@ RunSetup(rle_hdr * const hdrP) {
     /* We need to be able to count 2 bytes for each channel of each entry
        in the color map:
     */
-    if (1 << hdrP->cmaplen > UINT_MAX/2/hdrP->ncmap) {
+    if (hdrP->ncmap > 0 && 1 << hdrP->cmaplen > UINT_MAX/2/hdrP->ncmap) {
         pm_error("Color map length %u and number of color channels in the "
                  "color map %u are too large for computation",
                  1 << hdrP->cmaplen, hdrP->ncmap);