xref: /PHP-7.2/ext/gd/tests/bug77479.phpt (revision 44fa0b0f)
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===DONE===
17--EXPECTF--
18Warning: imagewbmp(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
19 in %s on line %d
20
21Warning: imagewbmp(): Could not create WBMP in %s on line %d
22===DONE===
23--CLEAN--
24<?php
25@unlink(__DIR__ . '/77479.wbmp');
26?>
27