summaryrefslogtreecommitdiff
path: root/third_party/lcms/0002-old-performance-fix.patch
blob: cea2bee94b97bb9465a1178007e478f60c2b95b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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);
 }