From ab11c20d59a71cb758b1b0ac5781c72b7184e073 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 18 Mar 2024 15:02:29 +0100 Subject: [PATCH] hlsdemux2: Avoid NULL pointer usage The pending/current variant are both NULL when the demuxer is resetted. Part-of: --- .../gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c index 34a8f99dce..fbdd45337f 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c @@ -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); }