diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-07-10 15:02:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-07-12 13:51:17 +0400 |
commit | 9f6c9ca636e3e0becac4fdf3805f86eb78939be9 (patch) | |
tree | c26aad660d3e921e199d01f234f6e06a4edcc3cb /source/blender/editors | |
parent | 4587d27108ff806a6a97a65a4f81aab35fe5812a (diff) |
Fix for invalid memory access in graph editor when deleting the last
vertex in a fcurve.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/animation/anim_deps.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_edit.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 1 |
3 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 1ca2c247ff0..640349199be 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -364,12 +364,14 @@ void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data) if (ale->update & ANIM_UPDATE_ORDER) { ale->update &= ~ANIM_UPDATE_ORDER; - sort_time_fcurve(fcu); + if (fcu) + sort_time_fcurve(fcu); } if (ale->update & ANIM_UPDATE_HANDLES) { ale->update &= ~ANIM_UPDATE_HANDLES; - calchandles_fcurve(fcu); + if (fcu) + calchandles_fcurve(fcu); } if (ale->update & ANIM_UPDATE_DEPS) { diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 08dd00c08fe..091d3fe56b4 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -878,8 +878,10 @@ static bool delete_action_keys(bAnimContext *ac) changed = delete_fcurve_keys(fcu); /* Only delete curve too if it won't be doing anything anymore */ - if ((fcu->totvert == 0) && (list_has_suitable_fmodifier(&fcu->modifiers, 0, FMI_TYPE_GENERATE_CURVE) == 0)) + if ((fcu->totvert == 0) && (list_has_suitable_fmodifier(&fcu->modifiers, 0, FMI_TYPE_GENERATE_CURVE) == 0)) { ANIM_fcurve_delete_from_animdata(ac, adt, fcu); + ale->key_data = NULL; + } } if (changed) { diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 6ed7689a6c3..1f1aac8c456 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -907,6 +907,7 @@ static bool delete_graph_keys(bAnimContext *ac) (fcu->driver == NULL)) { ANIM_fcurve_delete_from_animdata(ac, adt, fcu); + ale->key_data = NULL; } } |