Package: gst-plugins-good1.0 / 1.4.4-2+deb8u3

0004-qtdemux-Fix-out-of-bounds-read-in-tag-parsing-code.patch Patch series | 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 d0949baf3dadea6021d54abef6802fed5a06af75 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
Date: Thu, 1 Dec 2016 13:32:22 +0200
Subject: [PATCH] qtdemux: Fix out of bounds read in tag parsing code

We can't simply assume that the length of the tag value as given
inside the stream is correct but should also check against the amount of
data we have actually available.

https://bugzilla.gnome.org/show_bug.cgi?id=775451
---
 gst/isomp4/qtdemux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: gst-plugins-good1.0-1.4.4/gst/isomp4/qtdemux.c
===================================================================
--- gst-plugins-good1.0-1.4.4.orig/gst/isomp4/qtdemux.c
+++ gst-plugins-good1.0-1.4.4/gst/isomp4/qtdemux.c
@@ -9201,7 +9201,7 @@ qtdemux_tag_add_str_full (GstQTDemux * q
   } else {
     len = QT_UINT32 (node->data);
     type = QT_UINT32 ((guint8 *) node->data + 4);
-    if ((type >> 24) == 0xa9) {
+    if ((type >> 24) == 0xa9 && len > 8 + 4) {
       gint str_len;
       gint lang_code;
 
@@ -9220,7 +9220,7 @@ qtdemux_tag_add_str_full (GstQTDemux * q
       }
 
       offset = 12;
-      len = str_len + 8 + 4;    /* remove trailing strings that we don't use */
+      len = MIN (len, str_len + 8 + 4); /* remove trailing strings that we don't use */
       GST_DEBUG_OBJECT (qtdemux, "found international text tag");
 
       if (lang_code < 0x800) {  /* MAC encoded string */