diff options
author | Jan Alexander Steffens (heftig) <jsteffens@make.tv> | 2017-09-27 09:39:02 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-10-19 15:47:03 +0200 |
commit | 025633b16278a49a30d9b4fe0120a7470d7a07bd (patch) | |
tree | c3c7322266d4cc20b850575093fedf722c25e6d8 /ext/hls | |
parent | f80ad048e6f854ee0e069c1e818f405f9508ec21 (diff) | |
download | gstreamer-plugins-bad-025633b16278a49a30d9b4fe0120a7470d7a07bd.tar.gz |
m3u8: Ignore empty playlists in check_media_seqnums
Let these error in the immediately following check in gst_m3u8_update.
https://bugzilla.gnome.org/show_bug.cgi?id=788417
Diffstat (limited to 'ext/hls')
-rw-r--r-- | ext/hls/m3u8.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/hls/m3u8.c b/ext/hls/m3u8.c index 07babd13b..654067cd5 100644 --- a/ext/hls/m3u8.c +++ b/ext/hls/m3u8.c @@ -316,6 +316,11 @@ check_media_seqnums (GstM3U8 * self, GList * previous_files) g_return_val_if_fail (previous_files, FALSE); + if (!self->files) { + /* Empty playlists are trivially consistent */ + return TRUE; + } + /* Find first case of higher/equal sequence number in new playlist or * same URI. From there on we can linearly step ahead */ for (l = self->files; l; l = l->next) { @@ -334,6 +339,10 @@ check_media_seqnums (GstM3U8 * self, GList * previous_files) break; } + /* We must have seen at least one entry on each list */ + g_assert (f1 != NULL); + g_assert (f2 != NULL); + if (!l) { /* No match, no sequence in the new playlist was higher than * any in the old, and no URI was found again. This is bad! */ @@ -341,9 +350,6 @@ check_media_seqnums (GstM3U8 * self, GList * previous_files) return FALSE; } - g_assert (f1 != NULL); - g_assert (f2 != NULL); - for (; l && m; l = l->next, m = m->next) { f1 = l->data; f2 = m->data; |