summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2006-07-17 14:30:21 +0000
committerPierre Joye <pajoye@php.net>2006-07-17 14:30:21 +0000
commit2a06ce851817feb1026a4b22ad388b0a76a30acb (patch)
tree307b0b7d936122185f7dcd40df3ebf98b4cd3797
parentcb41a19f2827774487964b5888b7a31641b08030 (diff)
downloadphp-git-2a06ce851817feb1026a4b22ad388b0a76a30acb.tar.gz
- #38112, add test and use MAX_LWZ_BITS instead of the value
-rw-r--r--ext/gd/libgd/gd_gif_in.c2
-rw-r--r--ext/gd/tests/bug38112.gifbin0 -> 18276 bytes
-rw-r--r--ext/gd/tests/bug38112.phpt17
3 files changed, 18 insertions, 1 deletions
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
--- /dev/null
+++ b/ext/gd/tests/bug38112.gif
Binary files 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--
+<?php
+ if (!extension_loaded('gd')) {
+ die("skip gd extension not available\n");
+ }
+ if (!GD_BUNDLED) {
+ die('skip external GD libraries may fail');
+ }
+?>
+--FILE--
+<?php
+$im = imagecreatefromgif(dirname(__FILE__) . '/bug38112.gif');
+?>
+--EXPECTF--
+Warning: imagecreatefromgif(): '%sbug38112.gif' is not a valid GIF file in %sbug38112.php on line %d