From ef70cd48c6167d42fb36e0d743e16eafc99fb8f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 28 Feb 2017 15:53:10 +0200 Subject: [PATCH] dashdemux: Fix potential NULL pointer dereference CID 1399700 --- ext/dash/gstdashdemux.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index 756983cd23..2f34148671 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -1176,8 +1176,13 @@ gst_dash_demux_stream_update_fragment_info (GstAdaptiveDemuxStream * stream) } } g_free (dashstream->last_representation_id); - dashstream->last_representation_id = - g_strdup (dashstream->active_stream->cur_representation->id); + if (dashstream->active_stream + && dashstream->active_stream->cur_representation) { + dashstream->last_representation_id = + g_strdup (dashstream->active_stream->cur_representation->id); + } else { + dashstream->last_representation_id = NULL; + } } if (GST_ADAPTIVE_DEMUX_STREAM_NEED_HEADER (stream)) {