Blob Blame Raw
From cc8c2da2c3a267548f76b0d6c95b83e449dbe0f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
Date: Wed, 23 Nov 2016 10:51:17 +0200
Subject: [PATCH 2/4] h264parse: Ensure codec_data has the required size when
 reading number of SPS

https://bugzilla.gnome.org/show_bug.cgi?id=774896
---
 gst/videoparsers/gsth264parse.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
index 05b6b75..a5cbe6e 100644
--- a/gst/videoparsers/gsth264parse.c
+++ b/gst/videoparsers/gsth264parse.c
@@ -2534,6 +2534,10 @@ gst_h264_parse_set_caps (GstBaseParse * parse, GstCaps * caps)
       off = nalu.offset + nalu.size;
     }
 
+    if (off >= size) {
+      gst_buffer_unmap (codec_data, &map);
+      goto avcc_too_small;
+    }
     num_pps = data[off];
     off++;
 
-- 
2.9.3