From 22569a437fa787e4900a270d73de53f2bc1ec13a Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Sat, 29 Dec 2012 10:21:37 +0000
Subject: [PATCH 2/2] Do not attempt to write non-ICC parametric curve types

If a plugin registers a new cmsSigParametricCurveType and we're creating a V4
profile then do not attempt to write it into the profile as an ICC parametric
curve type. Instead write it as a table-based cmsSigCurveType.
---
 src/cmstypes.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/cmstypes.c b/src/cmstypes.c
index d9743ca..2a01050 100644
--- a/src/cmstypes.c
+++ b/src/cmstypes.c
@@ -1182,6 +1182,7 @@ cmsTagTypeSignature DecideCurveType(cmsFloat64Number ICCVersion, const void *Dat
     if (ICCVersion < 4.0) return cmsSigCurveType;
     if (Curve ->nSegments != 1) return cmsSigCurveType;          // Only 1-segment curves can be saved as parametric
     if (Curve ->Segments[0].Type < 0) return cmsSigCurveType;    // Only non-inverted curves
+    if (Curve ->Segments[0].Type > 5) return cmsSigCurveType;    // Only ICC parametric curves
 
     return cmsSigParametricCurveType;
 }
-- 
1.8.0.2

