From 40773632e0e942639a5c4d53357bedf72e6922aa Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 30 Jul 2004 01:10:42 +0000 Subject: [PATCH] MFH: Fixed bug #29443 (Sanity check for wbmp detection). --- ext/standard/image.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/standard/image.c b/ext/standard/image.c index c2c3c7ab86..329cd92bd6 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -955,6 +955,11 @@ static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check T } height = (height << 7) | (i & 0x7f); } while (i & 0x80); + + /* maximum valid sizes for wbmp (although 127x127 may be a more accurate one) */ + if (height > 2048 || width > 2048) { + return 0; + } if (!check) { (*result)->width = width; -- 2.40.0