summaryrefslogtreecommitdiff
path: root/ext/gd/tests/bug77269.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/tests/bug77269.phpt')
-rw-r--r--ext/gd/tests/bug77269.phpt21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/gd/tests/bug77269.phpt b/ext/gd/tests/bug77269.phpt
new file mode 100644
index 0000000000..3bdc23e80a
--- /dev/null
+++ b/ext/gd/tests/bug77269.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #77269 (Potential unsigned underflow in gdImageScale)
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip gd extension not available');
+if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+?>
+--INI--
+memory_limit=2G
+--FILE--
+<?php
+$im = imagecreate(2**28, 1);
+if(is_resource($im)) {
+ imagescale($im, 1, 1, IMG_TRIANGLE);
+}
+?>
+===DONE===
+--EXPECTF--
+Warning: imagecreate():%S product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
+ in %s on line %d
+===DONE===