[Bf-blender-cvs] [f30b60d] master: Fix: Crash when using "On Selected Markers" mode for Propogate Pose with no markers present

Joshua Leung noreply at git.blender.org
Thu Apr 2 12:50:23 CEST 2015


Commit: f30b60d1397d8109d6fb25188eace7b8d3a7e1d5
Author: Joshua Leung
Date:   Thu Apr 2 23:47:55 2015 +1300
Branches: master
https://developer.blender.org/rBf30b60d1397d8109d6fb25188eace7b8d3a7e1d5

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)

===================================================================

M	source/blender/editors/animation/anim_markers.c

===================================================================

diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 140b7e0..6866074 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);




More information about the Bf-blender-cvs mailing list