summaryrefslogtreecommitdiff
path: root/gst/typefind
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2018-07-06 13:48:09 +0200
committerEdward Hervey <bilboed@bilboed.com>2018-07-06 13:48:09 +0200
commit2657fc1fdd5ea761889c427188d5ae34d5fd9ca1 (patch)
tree1229e35c4cf78c72eaf69bf0f2e3f2116412ad72 /gst/typefind
parent38ba954e823605099eab8b9c70b79db0543eb092 (diff)
downloadgstreamer-plugins-base-2657fc1fdd5ea761889c427188d5ae34d5fd9ca1.tar.gz
typefindfunctions: Bail out on huge EBML chunks
We can't handle/store more than guint32 anyway
Diffstat (limited to 'gst/typefind')
-rw-r--r--gst/typefind/gsttypefindfunctions.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c
index b260999db..8d3b6fd45 100644
--- a/gst/typefind/gsttypefindfunctions.c
+++ b/gst/typefind/gsttypefindfunctions.c
@@ -4388,6 +4388,11 @@ ebml_parse_chunk (GstTypeFind * tf, DataScanCtx * ctx, guint32 chunk_id,
SPACES + sizeof (SPACES) - 1 - (2 * depth), id, element_size,
hdr_len + element_size);
+ if (element_size >= G_MAXUINT32) {
+ GST_DEBUG ("Chunk too big for typefinding");
+ return FALSE;
+ }
+
if (!data_scan_ctx_ensure_data (tf, &c, element_size)) {
GST_DEBUG ("not enough data");
return FALSE;