summaryrefslogtreecommitdiff
path: root/third_party/lcms/0002-old-performance-fix.patch
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/lcms/0002-old-performance-fix.patch')
-rw-r--r--third_party/lcms/0002-old-performance-fix.patch13
1 files changed, 13 insertions, 0 deletions
diff --git a/third_party/lcms/0002-old-performance-fix.patch b/third_party/lcms/0002-old-performance-fix.patch
new file mode 100644
index 0000000000..cea2bee94b
--- /dev/null
+++ b/third_party/lcms/0002-old-performance-fix.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/lcms/src/cmsgamma.c b/third_party/lcms/src/cmsgamma.c
+index edb8f6bba..eb3dd881c 100644
+--- a/third_party/lcms/src/cmsgamma.c
++++ b/third_party/lcms/src/cmsgamma.c
+@@ -799,7 +799,7 @@ void CMSEXPORT cmsFreeToneCurveTriple(cmsToneCurve* Curve[3])
+ // Duplicate a gamma table
+ cmsToneCurve* CMSEXPORT cmsDupToneCurve(const cmsToneCurve* In)
+ {
+- if (In == NULL) return NULL;
++ if (In == NULL || In ->Segments == NULL || In ->Table16 == NULL) return NULL;
+
+ return AllocateToneCurveStruct(In ->InterpParams ->ContextID, In ->nEntries, In ->nSegments, In ->Segments, In ->Table16);
+ }