xref: /PHP-8.0/ext/gd/tests/bug77479.phpt (revision d1764ca3)
1--TEST--
2Bug #77479 (imagewbmp() segfaults with very large image)
3--SKIPIF--
4<?php
5if (!extension_loaded('gd')) die('skip gd extension not available');
6if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
7?>
8--INI--
9memory_limit=-1
10--FILE--
11<?php
12$im = imagecreate(40000, 20000);
13imagecolorallocate($im, 0, 0, 0);
14imagewbmp($im, __DIR__ . '/77479.wbmp');
15?>
16--EXPECTF--
17Warning: imagewbmp():%S Product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
18 in %s on line %d
19
20Warning: imagewbmp(): Could not create WBMP in %s on line %d
21--CLEAN--
22<?php
23@unlink(__DIR__ . '/77479.wbmp');
24?>
25