From 0428b4afdac8d43b938a9fad8e5cdc0a8be53393 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 7 Dec 2017 14:52:36 +0100 Subject: [PATCH] typefind: wavpack: limit search in blocksize The maximum blocksize is 131072 bytes, anything bigger is a corrupted file. --- gst/typefind/gsttypefindfunctions.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index f905dda26b..d37d4a4ff3 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -1966,6 +1966,9 @@ wavpack_type_find (GstTypeFind * tf, gpointer unused) * work in pull-mode */ blocksize = GST_READ_UINT32_LE (data + 4); GST_LOG ("wavpack header, blocksize=0x%04x", blocksize); + /* If bigger than maximum allowed blocksize, refuse */ + if (blocksize > 131072) + return; count_wv = 0; count_wvc = 0; offset = 32;