xref: /PHP-7.2/ext/gd/tests/bug77272.phpt (revision 772b1cb2)
1--TEST--
2Bug #77272 (imagescale() may return image resource on failure)
3--INI--
4memory_limit=-1
5--SKIPIF--
6<?php
7if (!extension_loaded('gd')) die('skip gd extension not available');
8if (!GD_BUNGLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released');
9if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
10?>
11--FILE--
12<?php
13$img = imagecreate(2**28, 1);
14var_dump(imagescale($img, 1, 1, IMG_TRIANGLE));
15?>
16===DONE===
17--EXPECTF--
18Warning: imagescale():%S product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
19 in %s on line %d
20bool(false)
21===DONE===
22