From: Pierre Joye Date: Mon, 17 Jul 2006 14:30:21 +0000 (+0000) Subject: - #38112, add test and use MAX_LWZ_BITS instead of the value X-Git-Tag: php-5.2.0RC1~79 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a06ce851817feb1026a4b22ad388b0a76a30acb;p=php - #38112, add test and use MAX_LWZ_BITS instead of the value --- diff --git a/ext/gd/libgd/gd_gif_in.c b/ext/gd/libgd/gd_gif_in.c index b4bc7752d0..e3d635b31f 100644 --- a/ext/gd/libgd/gd_gif_in.c +++ b/ext/gd/libgd/gd_gif_in.c @@ -522,7 +522,7 @@ static void ReadImage(gdImagePtr im, gdIOCtx *fd, int len, int height, unsigned return; } - if (c > 8) { + if (c > MAX_LWZ_BITS) { return; } diff --git a/ext/gd/tests/bug38112.gif b/ext/gd/tests/bug38112.gif new file mode 100644 index 0000000000..178d27e357 Binary files /dev/null and b/ext/gd/tests/bug38112.gif differ diff --git a/ext/gd/tests/bug38112.phpt b/ext/gd/tests/bug38112.phpt new file mode 100644 index 0000000000..6c52271248 --- /dev/null +++ b/ext/gd/tests/bug38112.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #38112 (GIF Invalid Code size ). +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: imagecreatefromgif(): '%sbug38112.gif' is not a valid GIF file in %sbug38112.php on line %d