diff options
author | Thiago Santos <thiago.sousa.santos@collabora.com> | 2013-07-02 21:28:26 -0300 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.com> | 2013-07-03 10:23:45 -0300 |
commit | 94c6497dfae630ff34106ab37a40d2d866725580 (patch) | |
tree | a84e928d98be96e44c096e6d0400da66a803b4c5 /ext | |
parent | cd26bd51a193e27ba31563a7637ee1935787f74b (diff) |
dashdemux: protect from access to empty list data
Check if the list has elements before trying to access the last one
and causing a segfault
Diffstat (limited to 'ext')
-rw-r--r-- | ext/dash/gstmpdparser.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index e46e74115..76d2f02cf 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -2940,7 +2940,7 @@ gst_mpd_client_setup_representation (GstMpdClient * client, } /* check duration of last segment */ - last_media_segment = g_list_last (stream->segments)->data; + last_media_segment = stream->segments ? g_list_last (stream->segments)->data : NULL; if (last_media_segment && GST_CLOCK_TIME_IS_VALID (PeriodEnd)) { if (last_media_segment->start_time + last_media_segment->duration > PeriodEnd) { |