typefind: wavpack: limit search in blocksize
authorEdward Hervey <edward@centricular.com>
Thu, 7 Dec 2017 13:52:36 +0000 (14:52 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 7 Dec 2017 14:05:07 +0000 (15:05 +0100)
The maximum blocksize is 131072 bytes, anything bigger is a corrupted
file.

gst/typefind/gsttypefindfunctions.c

index f905dda..d37d4a4 100644 (file)
@@ -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;