From 571f9b0f23f31741f3c5947b839411acfefae3cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Tue, 9 Jul 2024 11:27:26 +0200 Subject: [PATCH] demux/ebml: fix ebml size check There was one zero too many. Change the limit to 128 MiB with more readable notation. --- demux/ebml.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demux/ebml.c b/demux/ebml.c index 7f62f1ff90..206a507a61 100644 --- a/demux/ebml.c +++ b/demux/ebml.c @@ -604,8 +604,8 @@ int ebml_read_element(struct stream *s, struct ebml_parse_ctx *ctx, MP_MSG(ctx, msglevel, "EBML element with unknown length - unsupported\n"); return -1; } - if (length > 1000000000) { - MP_MSG(ctx, msglevel, "Refusing to read element over 100 MB in size\n"); + if (length > (128 << 20)) { + MP_MSG(ctx, msglevel, "Refusing to read element over 128 MiB in size\n"); return -1; } ctx->talloc_ctx = talloc_size(NULL, length);