summaryrefslogtreecommitdiff
path: root/ext/gd/tests/bug74435.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/tests/bug74435.phpt')
-rw-r--r--ext/gd/tests/bug74435.phpt27
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/gd/tests/bug74435.phpt b/ext/gd/tests/bug74435.phpt
new file mode 100644
index 0000000000..9d11eb3839
--- /dev/null
+++ b/ext/gd/tests/bug74435.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #74435 (Buffer over-read into uninitialized memory)
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip gd extension not available');
+?>
+--FILE--
+<?php
+$im = imagecreatefromgif(__DIR__ . DIRECTORY_SEPARATOR . 'bug74435.gif');
+var_dump($im);
+$width = imagesx($im);
+$height = imagesy($im);
+for ($i = 0; $i < $width; $i += 16) {
+ for ($j = 0; $j < $height; $j += 16) {
+ if (($index = imagecolorat($im, $i, $j)) >= 2) {
+ list($red, $green, $blue, $alpha) = array_values(imagecolorsforindex($im, $index));
+ if ($red !== 0 || $green !== 0 || $blue !== 0 || $alpha !== 0) {
+ echo "unexpected color at ($i, $j)\n";
+ }
+ }
+ }
+}
+?>
+===DONE===
+--EXPECTF--
+resource(%d) of type (gd)
+===DONE===