track-element: Avoid dereferencing NULL pointer

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ț <alexandru.balut@gmail.com>
Differential Revision: https://phabricator.freedesktop.org/D1370
This commit is contained in:
Thibault Saunier 2016-10-11 00:59:47 +02:00
parent aec1442d4c
commit 4432efcfad
2 changed files with 3 additions and 1 deletions

View file

@ -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);

View file

@ -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);
}