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