timeline: Cleanup the moved_clip list before rolling back
authorThibault Saunier <thibault.saunier@osg.samsung.com>
Fri, 3 Feb 2017 15:50:11 +0000 (12:50 -0300)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Sat, 4 Feb 2017 21:52:57 +0000 (18:52 -0300)
Otherwise we might end up using an already freed pointer

Differential Revision: https://phabricator.freedesktop.org/D1640

ges/ges-timeline.c

index 6f069e3..50b4072 100644 (file)
@@ -1730,6 +1730,7 @@ timeline_ripple_object (GESTimeline * timeline, GESTrackElement * obj,
       g_list_free (moved_clips);
       _set_start0 (GES_TIMELINE_ELEMENT (obj), position);
 
+      moved_clips = NULL;
       if (timeline->priv->needs_rollback && !timeline->priv->rolling_back) {
         timeline->priv->rolling_back = TRUE;
         for (tmp = mv_ctx->moving_trackelements; tmp; tmp = tmp->next) {
@@ -1745,6 +1746,7 @@ timeline_ripple_object (GESTimeline * timeline, GESTrackElement * obj,
 
         }
         g_list_free (moved_clips);
+        moved_clips = NULL;
         _set_start0 (GES_TIMELINE_ELEMENT (obj), position - offset);
 
         ges_timeline_emit_snappig (timeline, obj, NULL);