diff options
author | Marti Maria <marti.maria@littlecms.com> | 2023-05-16 16:32:42 +0200 |
---|---|---|
committer | Marti Maria <marti.maria@littlecms.com> | 2023-05-16 16:32:42 +0200 |
commit | e55b6fa4d3c5b7e08d9e4bc8c803a79ca908b5a4 (patch) | |
tree | b36fdc835152ea9e9a6e25948fb1df88ae230b74 /src | |
parent | f087232ced02e34c36b88e9d75d071aa46fec0ff (diff) | |
download | lcms2-e55b6fa4d3c5b7e08d9e4bc8c803a79ca908b5a4.tar.gz |
Thanks to ISOZAKI Nozomi to point out the issue.
Diffstat (limited to 'src')
-rw-r--r-- | src/cmsxform.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cmsxform.c b/src/cmsxform.c index c70b7cb..93e07f8 100644 --- a/src/cmsxform.c +++ b/src/cmsxform.c @@ -989,6 +989,19 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsPipeline* lut, } } + /** + * Check consistency for alpha channel copy + */ + if (*dwFlags & cmsFLAGS_COPY_ALPHA) + { + if (T_EXTRA(*InputFormat) != T_EXTRA(*OutputFormat)) + { + cmsSignalError(ContextID, cmsERROR_NOT_SUITABLE, "Mismatched alpha channels"); + cmsDeleteTransform(p); + return NULL; + } + } + p ->InputFormat = *InputFormat; p ->OutputFormat = *OutputFormat; p ->dwOriginalFlags = *dwFlags; |