File: qtdemux-Avoid-integer-overflow-when-parsing-Theora-e.patch

package info (click to toggle)
gst-plugins-good1.0 1.22.0-5%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 34,472 kB
  • sloc: ansic: 397,096; cpp: 6,924; asm: 3,140; objc: 1,529; yacc: 1,210; pascal: 506; python: 409; sh: 259; lex: 94; makefile: 58
file content (36 lines) | stat: -rw-r--r-- 1,189 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
Date: Thu, 26 Sep 2024 22:16:06 +0300
Subject: qtdemux: Avoid integer overflow when parsing Theora extension
Origin: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/2d7a11f5e6be5c323b2fed8158bc9df37752e495
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2024-47606

Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-166
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3851

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8044>
---
 subprojects/gst-plugins-good/gst/isomp4/qtdemux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -8172,7 +8172,7 @@ qtdemux_parse_theora_extension (GstQTDem
   end -= 8;
 
   while (buf < end) {
-    gint size;
+    guint32 size;
     guint32 type;
 
     size = QT_UINT32 (buf);
@@ -8180,7 +8180,7 @@ qtdemux_parse_theora_extension (GstQTDem
 
     GST_LOG_OBJECT (qtdemux, "%p %p", buf, end);
 
-    if (buf + size > end || size <= 0)
+    if (end - buf < size || size < 8)
       break;
 
     buf += 8;