Lines Matching refs:Curve
21 @@ -749,14 +749,19 @@ void CMSEXPORT cmsFreeToneCurve(cmsToneCurve* Curve)
25 - if (Curve == NULL) return;
27 + // Curve->InterpParams may be null
28 + if (Curve == NULL || Curve->InterpParams == NULL) return;
30 ContextID = Curve ->InterpParams->ContextID;
32 _cmsFreeInterpParams(Curve ->InterpParams);
33 + Curve ->InterpParams = NULL;
35 - if (Curve -> Table16)
36 + if (Curve -> Table16) {
37 _cmsFree(ContextID, Curve ->Table16);
38 + Curve ->Table16 = NULL;
41 if (Curve ->Segments) {
43 @@ -766,20 +771,30 @@ void CMSEXPORT cmsFreeToneCurve(cmsToneCurve* Curve)
45 if (Curve ->Segments[i].SampledPoints) {
46 _cmsFree(ContextID, Curve ->Segments[i].SampledPoints);
47 + Curve ->Segments[i].SampledPoints = NULL;
50 - if (Curve ->SegInterp[i] != 0)
51 + if (Curve ->SegInterp[i] != 0) {
52 _cmsFreeInterpParams(Curve->SegInterp[i]);
53 + Curve->SegInterp[i] = NULL;
57 _cmsFree(ContextID, Curve ->Segments);
58 + Curve ->Segments = NULL;
59 _cmsFree(ContextID, Curve ->SegInterp);
60 + Curve ->SegInterp = NULL;
63 - if (Curve -> Evals)
64 + if (Curve -> Evals) {
65 _cmsFree(ContextID, Curve -> Evals);
66 + Curve -> Evals = NULL;
69 - if (Curve) _cmsFree(ContextID, Curve);
70 + if (Curve) {
71 + _cmsFree(ContextID, Curve);
72 + Curve = NULL;
77 @@ -799,7 +814,10 @@ void CMSEXPORT cmsFreeToneCurveTriple(cmsToneCurve* Curve[3])