Download src/php/php-src/ext/gd/tests/bug38212.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 778 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/gd/tests/bug38212.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/gd/tests/bug38212.phpt
-
curl -L -o bug38212.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/gd/tests/bug38212.phpt
778 Bytes
| --TEST-- | |
| Bug #38212 (Seg Fault on invalid imagecreatefromgd2part() parameters) | |
| --EXTENSIONS-- | |
| gd | |
| --SKIPIF-- | |
| if (!GD_BUNDLED && version_compare(GD_VERSION, '2.3.3', '>=')) { | |
| die("skip test requires GD 2.3.2 or older"); | |
| } | |
| --FILE-- | |
| require __DIR__ . '/func.inc'; | |
| $file = __DIR__ . '/bug38212.gd2'; | |
| $im1 = imagecreatetruecolor(10,100); | |
| imagefill($im1, 0,0, 0xffffff); | |
| imagegd2($im1, $file); | |
| trycatch_dump( | |
| fn() => imagecreatefromgd2part($file, 0,0, -25, 10), | |
| fn() => imagecreatefromgd2part($file, 0,0, 10, -25) | |
| ); | |
| unlink($file); | |
| --EXPECT-- | |
| !! [ValueError] imagecreatefromgd2part(): Argument #4 ($width) must be greater than or equal to 1 | |
| !! [ValueError] imagecreatefromgd2part(): Argument #5 ($height) must be greater than or equal to 1 | |