mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
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
This commit is contained in:
parent
cd26bd51a1
commit
94c6497dfa
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue