summaryrefslogtreecommitdiff
path: root/src/cmslut.c
diff options
context:
space:
mode:
authorMarti Maria <info@littlecms.com>2012-09-10 13:32:36 +0200
committerMarti Maria <info@littlecms.com>2012-09-10 13:32:36 +0200
commit5d98f40ed58f6e8eb9aee6dd2d9467bbc8551ee7 (patch)
treec3fbde779f4331d745b89f9fcef87f48ebd12e07 /src/cmslut.c
parenteba3ad7ceb8fd0726daebf26f70d467726f3059b (diff)
downloadlcms2-5d98f40ed58f6e8eb9aee6dd2d9467bbc8551ee7.tar.gz
Fixed some menor issues for 2.4
Diffstat (limited to 'src/cmslut.c')
-rw-r--r--src/cmslut.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/cmslut.c b/src/cmslut.c
index 5e1f54e..b421456 100644
--- a/src/cmslut.c
+++ b/src/cmslut.c
@@ -544,6 +544,13 @@ cmsStage* CMSEXPORT cmsStageAllocCLut16bitGranular(cmsContext ContextID,
_cmsStageCLutData* NewElem;
cmsStage* NewMPE;
+ _cmsAssert(clutPoints != NULL);
+
+ if (inputChan > MAX_INPUT_DIMENSIONS) {
+ cmsSignalError(ContextID, cmsERROR_RANGE, "Too many input channels (%d channels, max=%d)", inputChan, MAX_INPUT_DIMENSIONS);
+ return NULL;
+ }
+
NewMPE = _cmsStageAllocPlaceholder(ContextID, cmsSigCLutElemType, inputChan, outputChan,
EvaluateCLUTfloatIn16, CLUTElemDup, CLutElemTypeFree, NULL );
@@ -631,6 +638,11 @@ cmsStage* CMSEXPORT cmsStageAllocCLutFloatGranular(cmsContext ContextID, const c
_cmsAssert(clutPoints != NULL);
+ if (inputChan > MAX_INPUT_DIMENSIONS) {
+ cmsSignalError(ContextID, cmsERROR_RANGE, "Too many input channels (%d channels, max=%d)", inputChan, MAX_INPUT_DIMENSIONS);
+ return NULL;
+ }
+
NewMPE = _cmsStageAllocPlaceholder(ContextID, cmsSigCLutElemType, inputChan, outputChan,
EvaluateCLUTfloat, CLUTElemDup, CLutElemTypeFree, NULL);
if (NewMPE == NULL) return NULL;
@@ -666,7 +678,6 @@ cmsStage* CMSEXPORT cmsStageAllocCLutFloatGranular(cmsContext ContextID, const c
}
-
NewElem ->Params = _cmsComputeInterpParamsEx(ContextID, clutPoints, inputChan, outputChan, NewElem ->Tab.TFloat, CMS_LERP_FLAGS_FLOAT);
if (NewElem ->Params == NULL) {
cmsStageFree(NewMPE);