hlsdemux2: Avoid NULL pointer usage

The pending/current variant are both NULL when the demuxer is resetted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6410>
This commit is contained in:
Edward Hervey 2024-03-18 15:02:29 +01:00 committed by Tim-Philipp Müller
parent 9ce063f5f6
commit 77fa0ae0e7

View file

@ -1296,6 +1296,10 @@ gst_hls_demux_check_variant_playlist_loaded (GstHLSDemux * demux)
demux->pending_variant ? demux->pending_variant : demux->current_variant;
GstHLSDemuxStream *stream = demux->main_stream;
/* The demuxer has been resetted in the meantime */
if (target_variant == NULL)
return GST_FLOW_FLUSHING;
return gst_hls_demux_stream_check_current_playlist_uri (stream,
target_variant->uri);
}