matroskademux: Skip over zero-sized Xiph stream headers

Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-251
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3867

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8057>
This commit is contained in:
Sebastian Dröge 2024-09-30 19:19:42 +03:00 committed by GStreamer Marge Bot
parent c20eff779d
commit b84a0f3263

View file

@ -189,8 +189,10 @@ gst_matroska_parse_xiph_stream_headers (gpointer codec_data,
if (offset + length[i] > codec_data_size)
goto error;
hdr = gst_buffer_new_memdup (p + offset, length[i]);
gst_buffer_list_add (list, hdr);
if (length[i] > 0) {
hdr = gst_buffer_new_memdup (p + offset, length[i]);
gst_buffer_list_add (list, hdr);
}
offset += length[i];
}