From ef0e8225594faebf50abea28029a0d55c4644b22 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Wed, 29 May 2024 16:35:37 +0300 Subject: [PATCH] hlsng: Check caps are not null after parsing HLS CODECS tag If the mime codec wasn't recognised, caps will be NULL and cause a critical Part-of: --- .../gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c index 9546a5b22e..69c73fff43 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c @@ -2863,8 +2863,12 @@ gst_hls_variant_parse (gchar * data, const gchar * base_uri) g_free (stream->codecs); stream->codecs = g_strdup (v); stream->caps = gst_codec_utils_caps_from_mime_codec (stream->codecs); - stream->codecs_stream_type = - gst_hls_get_stream_type_from_caps (stream->caps); + if (stream->caps != NULL) { + stream->codecs_stream_type = + gst_hls_get_stream_type_from_caps (stream->caps); + } else { + GST_WARNING ("Unhandled codec in CODECS tags: %s", v); + } } else if (g_str_equal (a, "RESOLUTION")) { if (!int_from_string (v, &v, &stream->width)) GST_WARNING ("Error while reading RESOLUTION width");