about summary refs log tree commit diff
path: root/converter
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-11-28 00:42:38 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-11-28 00:42:38 +0000
commit7f7604a82a6b776b025289b56e1f8ae11fcb0f96 (patch)
tree4af1d9e7da420a9b06dfaee960211a712fc55795 /converter
parent6665b1315384b3650add470d3d40b9c5190c3ca3 (diff)
downloadnetpbm-mirror-7f7604a82a6b776b025289b56e1f8ae11fcb0f96.tar.gz
netpbm-mirror-7f7604a82a6b776b025289b56e1f8ae11fcb0f96.tar.xz
netpbm-mirror-7f7604a82a6b776b025289b56e1f8ae11fcb0f96.zip
Add header check to go with previous update to header checks
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4186 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter')
-rw-r--r--converter/other/xwdtopnm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/converter/other/xwdtopnm.c b/converter/other/xwdtopnm.c
index 22399d47..ac541b98 100644
--- a/converter/other/xwdtopnm.c
+++ b/converter/other/xwdtopnm.c
@@ -593,6 +593,9 @@ processX11Header(X11WDFileHeader *  const h11P,
         *formatP = PPM_TYPE;
 
         /* See discussion above about this maxval */
+        if (h11FixedP->bits_per_rgb > 16)
+            pm_error("Invalid bits_per_rgb for TrueColor image: %u. "
+                     "Maximum possible is 16");
         *maxvalP = pm_bitstomaxval(h11FixedP->bits_per_rgb);
     } else if (*visualclassP == StaticGray && h11FixedP->bits_per_pixel == 1) {
         *formatP = PBM_TYPE;