hlsdemux2: Fix potential segfault

Fix a potential segfault if we receive a ISO-FF stream
with moof before moov.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2676>
This commit is contained in:
Jan Schmidt 2022-06-24 02:57:54 +10:00 committed by GStreamer Marge Bot
parent b2944c36ca
commit 4b7622b377

View file

@ -437,6 +437,11 @@ gst_hlsdemux_handle_content_isobmff (GstHLSDemux * demux,
{
GstMoofBox *moof;
if (hls_stream->moov == NULL) {
GST_WARNING ("Received moof with moov in iso-ff stream");
break;
}
gst_byte_reader_get_sub_reader (&br, &sub, box_size - header_size);
moof = gst_isoff_moof_box_parse (&sub);