diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-11 12:15:37 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-11 12:15:37 +0400 |
commit | 31c8f4fbd39374532af0033779f5853e4be7a528 (patch) | |
tree | ac2607d921bed8e3f7cbd10a3f2166b5f86d8173 /source | |
parent | 638211d4e6c3cc291d2c3fffcc35c9bfe7a2df51 (diff) |
fix for crashes in smooth-curves and clean-curves fcurve operators - missing NULL checks.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/animation/keyframes_general.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 14bee00a72a..f29be418941 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -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++) { |