1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Files
archived-php-src/ext/gd/tests/bug38212.phpt
T
Christoph M. Becker a375d54785 Migrate skip checks to --EXTENSIONS-- for ext/gd
Cf. PR #6787.

Closes GH-6994.
2021-05-22 15:38:51 +02:00

24 lines
630 B
PHP

--TEST--
Bug #38212 (Seg Fault on invalid imagecreatefromgd2part() parameters)
--EXTENSIONS--
gd
--FILE--
<?php
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