Fixed bug #29443 (Sanity check for wbmp detection).

This commit is contained in:
Ilia Alshanetsky 2004-07-30 01:10:41 +00:00
parent 381adeadff
commit 972940509f

View File

@ -955,6 +955,11 @@ static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check T
} }
height = (height << 7) | (i & 0x7f); height = (height << 7) | (i & 0x7f);
} while (i & 0x80); } 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) { if (!check) {
(*result)->width = width; (*result)->width = width;