Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2015-04-02 13:47:55 +0300
committerJoshua Leung <aligorith@gmail.com>2015-04-02 13:48:25 +0300
commitf30b60d1397d8109d6fb25188eace7b8d3a7e1d5 (patch)
tree9f70b4d96cb0cd7dabf84ff636ed3cb45a4b1f4e /source/blender/editors/animation
parent838c3503a78b1cc7a352e9722b39610319cc0bb3 (diff)
Fix: Crash when using "On Selected Markers" mode for Propogate Pose with no markers present
The function to get a list of markers was not clearing the list before it exited early, and with no way to tell that the method failed, callers could make the mistake of trusting that the list was now valid (i.e. either full of marker frames or empty, vs being invalid)
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/anim_markers.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 140b7e0b117..68660740ac7 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -266,8 +266,20 @@ void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, short only_sel)
{
TimeMarker *marker;
- if (markers == NULL)
+ if (lb) {
+ /* Clear the list first, since callers have no way of knowing
+ * whether this terminated early otherwise. This may lead
+ * to crashes if the user didn't clear the memory first.
+ */
+ lb->first = lb->last = NULL;
+ }
+ else {
+ return;
+ }
+
+ if (markers == NULL) {
return;
+ }
for (marker = markers->first; marker; marker = marker->next)
add_marker_to_cfra_elem(lb, marker, only_sel);