qtdemux: Check for invalid atom length when extracting Closed Caption data

Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-243
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3849

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8059>
This commit is contained in:
Sebastian Dröge 2024-09-26 19:16:19 +03:00 committed by GStreamer Marge Bot
parent 7d3f221d87
commit bfebca8307

View file

@ -6193,7 +6193,7 @@ extract_cc_from_data (QtDemuxStream * stream, const guint8 * data, gsize size,
goto invalid_cdat;
atom_length = QT_UINT32 (data);
fourcc = QT_FOURCC (data + 4);
if (G_UNLIKELY (atom_length > size || atom_length == 8))
if (G_UNLIKELY (atom_length > size || atom_length <= 8))
goto invalid_cdat;
GST_DEBUG_OBJECT (stream->pad, "here");