diff --git a/subprojects/gst-plugins-bad/gst/mpegtsdemux/tsdemux.c b/subprojects/gst-plugins-bad/gst/mpegtsdemux/tsdemux.c index a88f35efd4..26383a6c68 100644 --- a/subprojects/gst-plugins-bad/gst/mpegtsdemux/tsdemux.c +++ b/subprojects/gst-plugins-bad/gst/mpegtsdemux/tsdemux.c @@ -1256,7 +1256,8 @@ gst_ts_demux_create_tags (TSDemuxStream * stream) const GstMpegtsDescriptor *ac3_desc = mpegts_get_descriptor_from_stream (bstream, GST_MTS_DESC_AC3_AUDIO_STREAM); - if (ac3_desc && DESC_AC_AUDIO_STREAM_has_lang1 (ac3_desc->data)) { + if (ac3_desc && ac3_desc->length >= 8 + && DESC_AC_AUDIO_STREAM_has_lang1 (ac3_desc->data)) { gchar lang_code[4]; memcpy (lang_code, DESC_AC_AUDIO_STREAM_lang1_code (ac3_desc->data), 3);