mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 21:18:52 +00:00
hlsdemux: Fix dereferencing of NULL pointer
On some live HLS streams, gst_hls_demux_switch_playlist causes assertion failures because it tried to dereference a NULL fragment. This is because g_queue_peek_tail sometimes was returning NULL and this case was not being checked. This patch does two things: * move the g_queue_peek_tail inside the semaphore protection * check if q_queue_peek_tail returns NULL https://bugzilla.gnome.org/show_bug.cgi?id=708849
This commit is contained in:
parent
d7c7f54734
commit
0bdf13c36a
1 changed files with 3 additions and 2 deletions
|
@ -1213,11 +1213,12 @@ gst_hls_demux_switch_playlist (GstHLSDemux * demux)
|
||||||
GstClockTime diff;
|
GstClockTime diff;
|
||||||
gsize size;
|
gsize size;
|
||||||
gint bitrate;
|
gint bitrate;
|
||||||
GstFragment *fragment = g_queue_peek_tail (demux->queue);
|
GstFragment *fragment;
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
|
|
||||||
GST_M3U8_CLIENT_LOCK (demux->client);
|
GST_M3U8_CLIENT_LOCK (demux->client);
|
||||||
if (!demux->client->main->lists) {
|
fragment = g_queue_peek_tail (demux->queue);
|
||||||
|
if (!demux->client->main->lists || !fragment) {
|
||||||
GST_M3U8_CLIENT_UNLOCK (demux->client);
|
GST_M3U8_CLIENT_UNLOCK (demux->client);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue