xref: /PHP-8.1/ext/gd/tests/bug77269.phpt (revision 916b132e)
1--TEST--
2Bug #77269 (Potential unsigned underflow in gdImageScale)
3--EXTENSIONS--
4gd
5--SKIPIF--
6<?php
7if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
8if (substr(PHP_OS, 0, 3) == 'WIN' && PHP_INT_SIZE === 4) die("skip not for Windows x86");
9?>
10--INI--
11memory_limit=2G
12--FILE--
13<?php
14$im = imagecreate(2**28, 1);
15imagescale($im, 1, 1, IMG_TRIANGLE);
16
17?>
18--EXPECTF--
19Warning: imagescale():%S Product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
20 in %s on line %d
21