From 4432efcfad04cc87ea944f860d22c449b02df26d Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 11 Oct 2016 00:59:47 +0200 Subject: [PATCH] track-element: Avoid dereferencing NULL pointer MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We set TrackElement track type very early when creating effects so it now uses that information to find TrackElement in clips by track type. Reviewed-by: Alex Băluț Differential Revision: https://phabricator.freedesktop.org/D1370 --- ges/ges-clip.c | 2 +- ges/ges-track-element.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ges/ges-clip.c b/ges/ges-clip.c index d0b47fa..b810156 100644 --- a/ges/ges-clip.c +++ b/ges/ges-clip.c @@ -1623,7 +1623,7 @@ ges_clip_find_track_elements (GESClip * clip, GESTrack * track, tmptrack = ges_track_element_get_track (otmp); if (((track != NULL && tmptrack == track)) || (track_type != GES_TRACK_TYPE_UNKNOWN - && tmptrack->type == track_type)) { + && ges_track_element_get_track_type (otmp) == track_type)) { foundElement = GES_TRACK_ELEMENT (tmp->data); diff --git a/ges/ges-track-element.c b/ges/ges-track-element.c index 6fe5c9b..21f6ca4 100644 --- a/ges/ges-track-element.c +++ b/ges/ges-track-element.c @@ -815,6 +815,8 @@ ges_track_element_set_track (GESTrackElement * object, GESTrack * track) object->priv->track = track; if (object->priv->track) { + ges_track_element_set_track_type (object, track->type); + g_object_set (object->priv->nleobject, "caps", ges_track_get_caps (object->priv->track), NULL); } -- 2.7.4