summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarti Maria <marti.maria@littlecms.com>2022-11-27 17:39:58 +0100
committerMarti Maria <marti.maria@littlecms.com>2022-11-27 17:39:58 +0100
commitcaab4c07e60022a0f776b543eaa30785e2bb42ed (patch)
tree5f4b0169556ebf693dc1ad5ba1840b79942abe85 /src
parentc8ed7427b83df73f3039ef570c48c6b995c2a7ab (diff)
downloadlcms2-caab4c07e60022a0f776b543eaa30785e2bb42ed.tar.gz
fix a bug on BPC black point detection in case of matrix-shaper with inverted curves.
Thanks to Ralf Junker for finding the rare case.
Diffstat (limited to 'src')
-rw-r--r--src/cmssamp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cmssamp.c b/src/cmssamp.c
index f5957d1..124deff 100644
--- a/src/cmssamp.c
+++ b/src/cmssamp.c
@@ -123,10 +123,9 @@ cmsBool BlackPointAsDarkerColorant(cmsHPROFILE hInput,
// Convert black to Lab
cmsDoTransform(xform, Black, &Lab, 1);
- // Force it to be neutral, clip to max. L* of 50
+ // Force it to be neutral, check for inconsistences
Lab.a = Lab.b = 0;
- if (Lab.L > 50) Lab.L = 50;
- if (Lab.L < 0) Lab.L = 0;
+ if (Lab.L > 50 || Lab.L < 0) Lab.L = 0;
// Free the resources
cmsDeleteTransform(xform);