xref: /PHP-8.0/ext/gd/tests/bug72730.phpt (revision 14a26db3)
1--TEST--
2Bug #72730: imagegammacorrect allows arbitrary write access
3--SKIPIF--
4<?php
5if (!function_exists("imagecreatetruecolor")) die("skip");
6?>
7--FILE--
8<?php
9
10require __DIR__ . '/func.inc';
11
12$img =  imagecreatetruecolor(1, 1);
13
14trycatch_dump(
15    fn() => imagegammacorrect($img, -1, 1337)
16);
17
18?>
19--EXPECT--
20!! [ValueError] imagegammacorrect(): Argument #2 ($input_gamma) must be greater than 0
21