summaryrefslogtreecommitdiff
path: root/src/cmsio1.c
diff options
context:
space:
mode:
authorMarti Maria <marti.maria@littlecms.com>2023-01-03 11:30:38 +0100
committerMarti Maria <marti.maria@littlecms.com>2023-01-03 11:30:38 +0100
commit6223d3d3c8339eadba2230a0112cdeaca72c080e (patch)
tree10f137b27f8ac50f3acda3b84d0714ab193286bd /src/cmsio1.c
parent37eddd2d8787dbc5d707044cab0762bfc879fb3e (diff)
downloadlcms2-6223d3d3c8339eadba2230a0112cdeaca72c080e.tar.gz
Add range check for intents on cmsIsCLUT
Add some bound-check for bad API usage Fixes #350 Thanks for reporting!
Diffstat (limited to 'src/cmsio1.c')
-rw-r--r--src/cmsio1.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmsio1.c b/src/cmsio1.c
index 2d7deee..5df75fa 100644
--- a/src/cmsio1.c
+++ b/src/cmsio1.c
@@ -851,6 +851,10 @@ cmsBool CMSEXPORT cmsIsCLUT(cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUI
return FALSE;
}
+ // Extended intents are not strictly CLUT-based
+ if (Intent > INTENT_ABSOLUTE_COLORIMETRIC)
+ return FALSE;
+
return cmsIsTag(hProfile, TagTable[Intent]);
}