fix for crashes in smooth-curves and clean-curves fcurve operators - missing NULL checks.

This commit is contained in:
Campbell Barton
2012-06-11 08:15:37 +00:00
parent 638211d4e6
commit 31c8f4fbd3

View File

@@ -184,7 +184,7 @@ void clean_fcurve(FCurve *fcu, float thresh)
int totCount, i;
/* check if any points */
if ((fcu == NULL) || (fcu->totvert <= 1))
if ((fcu == NULL) || (fcu->bezt == NULL) || (fcu->totvert <= 1))
return;
/* make a copy of the old BezTriples, and clear IPO curve */
@@ -286,7 +286,11 @@ void smooth_fcurve(FCurve *fcu)
{
BezTriple *bezt;
int i, x, totSel = 0;
if (fcu->bezt == NULL) {
return;
}
/* first loop through - count how many verts are selected */
bezt = fcu->bezt;
for (i = 0; i < fcu->totvert; i++, bezt++) {