xref: /PHP-8.0/ext/gd/tests/bug72494.phpt (revision 50765075)
1--TEST--
2Bug #72494 (imagecropauto out-of-bounds access)
3--SKIPIF--
4<?php
5if (!extension_loaded('gd')) die('skip gd extension not available');
6?>
7--FILE--
8<?php
9require __DIR__ . '/func.inc';
10
11$im = imagecreate(10,10);
12
13trycatch_dump(
14    fn() => imagecropauto($im, IMG_CROP_THRESHOLD, 0, 1337)
15);
16
17?>
18--EXPECT--
19!! [ValueError] imagecropauto(): Argument #4 ($color) must be greater than or equal to 0 when using the threshold mode
20