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