From cff42b2b408ca07b93da92e11bdbb1aa30c275b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 12 Nov 2016 10:38:04 +0200 Subject: [PATCH] hlsdemux: Fix NULL pointer dereference when checking if there is a next fragment Thanks to Aleksandr for reporting and suggesting the fix. https://bugzilla.gnome.org/show_bug.cgi?id=774287 --- ext/hls/m3u8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/hls/m3u8.c b/ext/hls/m3u8.c index bdb4acf882..2f22c13bcb 100644 --- a/ext/hls/m3u8.c +++ b/ext/hls/m3u8.c @@ -711,7 +711,7 @@ gst_m3u8_has_next_fragment (GstM3U8 * m3u8, gboolean forward) cur = m3u8_find_next_fragment (m3u8, forward); } - have_next = (forward && cur->next) || (!forward && cur->prev); + have_next = cur && ((forward && cur->next) || (!forward && cur->prev)); GST_M3U8_UNLOCK (m3u8);