From 1c9021be51ad9fbeabdd4f55d9453c394d8d52ae Mon Sep 17 00:00:00 2001 From: Marti Maria Date: Mon, 15 Jul 2024 18:18:13 +0200 Subject: [PATCH] Add an extra check for channel count on undisclosed colorspaces An extra check never hurts --- src/cmsxform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmsxform.c b/src/cmsxform.c index 99e9bb96..2f8b4e5e 100644 --- a/src/cmsxform.c +++ b/src/cmsxform.c @@ -1070,7 +1070,7 @@ cmsBool IsProperColorSpace(cmsColorSpaceSignature Check, cmsUInt32Number dwForm int Space1 = (int) T_COLORSPACE(dwFormat); int Space2 = _cmsLCMScolorSpace(Check); - if (Space1 == PT_ANY) return TRUE; + if (Space1 == PT_ANY) return (T_CHANNELS(dwFormat) == cmsChannelsOf(Check)); if (Space1 == Space2) return TRUE; if (Space1 == PT_LabV2 && Space2 == PT_Lab) return TRUE;