GNOME Bugzilla – Bug 708849
hlsdemux: occasionally dereferencing NULL in gst_hls_demux_switch_playlist()
Last modified: 2013-09-30 08:41:34 UTC
When watching a live HLS stream, once or twice a minute I am getting assertion errors from gstreamer. For example: 0:03:40.982580889 7873 0x49d520 DEBUG hlsdemux /data/alex.ashley/builds/gst_plugins_bad/ext/hls/gsthlsdemux.c:715:gst_hls_demux_stream_loop:<hlsdemux0> Enter task 0:03:40.983197112 7873 0x49d520 DEBUG hlsdemux /data/alex.ashley/builds/gst_plugins_bad/ext/hls/gsthlsdemux.c:766:gst_hls_demux_stream_loop:<hlsdemux0> Pushing buffer 0x50f678 0:03:40.983746482 7873 0x49d520 DEBUG hlsdemux /data/alex.ashley/builds/gst_plugins_bad/ext/hls/gsthlsdemux.c:772:gst_hls_demux_stream_loop:<hlsdemux0> Pushed buffer 0:03:40.984267741 7873 0x49d520 DEBUG hlsdemux /data/alex.ashley/builds/gst_plugins_bad/ext/hls/gsthlsdemux.c:715:gst_hls_demux_stream_loop:<hlsdemux0> Enter task 0:03:40.984763963 7873 0x49d520 DEBUG hlsdemux /data/alex.ashley/builds/gst_plugins_bad/ext/hls/gsthlsdemux.c:811:gst_hls_demux_stream_loop:<hlsdemux0> Pause task ** (gst-launch-1.0:7873): CRITICAL **: gst_fragment_get_buffer: assertion `fragment != NULL' failed (gst-launch-1.0:7873): GStreamer-CRITICAL **: gst_buffer_get_sizes_range: assertion `GST_IS_BUFFER (buffer)' failed 0:03:40.986015853 7873 0x4a01b0 DEBUG hlsdemux /data/alex.ashley/builds/gst_plugins_bad/ext/hls/gsthlsdemux.c:1240:gst_hls_demux_switch_playlist: Downloaded 0 bytes in 0:00:01.036940000. Bitrate is : 0 (gst-launch-1.0:7873): GStreamer-CRITICAL **: gst_mini_object_unref: assertion `mini_object != NULL' failed 0:03:40.987081519 7873 0x4a01b0 DEBUG hlsdemux /data/alex.ashley/builds/gst_plugins_bad/ext/hls/gsthlsdemux.c:1209:gst_hls_demux_schedule:<hlsdemux0> Next update scheduled at 2013-09-26T15:27:46.895906Z 0:03:40.987728704 7873 0x4a01b0 DEBUG hlsdemux /data/alex.ashley/builds/gst_plugins_bad/ext/hls/gsthlsdemux.c:887:gst_hls_demux_updates_loop:<hlsdemux0> Waiting Tracing through the code, this is being caused by gst_hls_demux_switch_playlist because the fragment variable is NULL and this function does not check for this situation.
Created attachment 255850 [details] [review] Fix for NULL dereference This patch does two things: * move the g_queue_peek_tail inside the semaphore protection * check if q_queue_peek_tail returns NULL
commit 0bdf13c36ae61e150fe6c56d3c4a4e6ab3188ca2 Author: Alex Ashley <bugzilla@ashley-family.net> Date: Thu Sep 26 16:51:25 2013 +0100 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