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