From 7f7604a82a6b776b025289b56e1f8ae11fcb0f96 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 28 Nov 2021 00:42:38 +0000 Subject: 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 --- converter/other/xwdtopnm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'converter') 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; -- cgit 1.4.1