summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Knechtges <philipp-dev@knechtges.com>2020-05-17 21:00:26 +0200
committerAlbert Astals Cid <tsdgeos@yahoo.es>2020-05-21 09:00:29 +0000
commitcc0f7960fd9dc4cfda8dc15cb061f891e909b386 (patch)
tree5dcf37d5dd9306c74a61c74fc8dd6ca178c7386e
parent2334bea5208d0506e4eee02ed170abd7e73e2fe4 (diff)
only activate CSA support for the most recent lcms2 version
Add a runtime check.
-rw-r--r--poppler/GfxState.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 339614b2..105ef1dc 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -224,6 +224,15 @@ unsigned int GfxColorTransform::unref() {
char *GfxColorTransform::getPostScriptCSA()
{
+#if LCMS_VERSION>=2070
+ // The runtime version check of lcms2 is only available from release 2.7 upwards.
+ // The generation of the CSA code only works reliably for version 2.10 and upwards.
+ // Cf. the explanation in the corresponding lcms2 merge request [1], and the original mail thread [2].
+ // [1] https://github.com/mm2/Little-CMS/pull/214
+ // [2] https://sourceforge.net/p/lcms/mailman/message/33182987/
+ if (cmsGetEncodedCMMversion() < 2100)
+ return nullptr;
+
int size;
if (psCSA)
@@ -245,6 +254,9 @@ char *GfxColorTransform::getPostScriptCSA()
psCSA[size] = 0;
return psCSA;
+#else
+ return nullptr;
+#endif
}
static cmsHPROFILE RGBProfile = nullptr;