diff options
Diffstat (limited to 'src/cmsxform.c')
-rw-r--r-- | src/cmsxform.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cmsxform.c b/src/cmsxform.c index aa6b41c..73db5e2 100644 --- a/src/cmsxform.c +++ b/src/cmsxform.c @@ -644,6 +644,13 @@ cmsHTRANSFORM CMSEXPORT cmsCreateExtendedTransform(cmsContext ContextID, return NULL; } + // Check channel count + if ((cmsChannelsOf(EntryColorSpace) != cmsPipelineInputChannels(Lut)) || + (cmsChannelsOf(ExitColorSpace) != cmsPipelineOutputChannels(Lut))) { + cmsSignalError(ContextID, cmsERROR_NOT_SUITABLE, "Channel count doesn't match. Profile is corrupted"); + return NULL; + } + // All seems ok xform = AllocEmptyTransform(ContextID, Lut, LastIntent, &InputFormat, &OutputFormat, &dwFlags); |