qtdemux: Check for invalid atom length when extracting Closed Caption data
authorSebastian Dröge <sebastian@centricular.com>
Thu, 26 Sep 2024 16:16:19 +0000 (19:16 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 3 Dec 2024 20:35:20 +0000 (22:35 +0200)
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/8060>

subprojects/gst-plugins-good/gst/isomp4/qtdemux.c

index fa8a469a4c235e20754f1a3f496f7e467dd19d08..39b0b80dad3a19342a31d0d65254104c3fa73489 100644 (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");