diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-10-20 21:12:44 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-10-20 21:12:44 +0000 |
commit | aa32dffb962d0159f91f4374a676c66ef63a2fa8 (patch) | |
tree | 63ca4df5e4ee43899c8283c66dd9f16f1480b3c9 /urt | |
parent | 2fb0317678ee7db8c2fcba3e33c9cb9a6ca4a3b4 (diff) | |
download | netpbm-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.c | 2 |
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); |