timeline: Cleanup the moved_clip list before rolling back

Otherwise we might end up using an already freed pointer

Differential Revision: https://phabricator.freedesktop.org/D1640
This commit is contained in:
Thibault Saunier 2017-02-03 12:50:11 -03:00
parent 02e151bce6
commit a563578b0a

View file

@ -1730,6 +1730,7 @@ timeline_ripple_object (GESTimeline * timeline, GESTrackElement * obj,
g_list_free (moved_clips); g_list_free (moved_clips);
_set_start0 (GES_TIMELINE_ELEMENT (obj), position); _set_start0 (GES_TIMELINE_ELEMENT (obj), position);
moved_clips = NULL;
if (timeline->priv->needs_rollback && !timeline->priv->rolling_back) { if (timeline->priv->needs_rollback && !timeline->priv->rolling_back) {
timeline->priv->rolling_back = TRUE; timeline->priv->rolling_back = TRUE;
for (tmp = mv_ctx->moving_trackelements; tmp; tmp = tmp->next) { 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); g_list_free (moved_clips);
moved_clips = NULL;
_set_start0 (GES_TIMELINE_ELEMENT (obj), position - offset); _set_start0 (GES_TIMELINE_ELEMENT (obj), position - offset);
ges_timeline_emit_snappig (timeline, obj, NULL); ges_timeline_emit_snappig (timeline, obj, NULL);