summaryrefslogtreecommitdiff
path: root/ext/gd/tests/bug38212-mb.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/tests/bug38212-mb.phpt')
-rw-r--r--ext/gd/tests/bug38212-mb.phpt14
1 files changed, 11 insertions, 3 deletions
diff --git a/ext/gd/tests/bug38212-mb.phpt b/ext/gd/tests/bug38212-mb.phpt
index a7a3d65f13..d69d604e5d 100644
--- a/ext/gd/tests/bug38212-mb.phpt
+++ b/ext/gd/tests/bug38212-mb.phpt
@@ -6,12 +6,20 @@ Bug #38212 (Seg Fault on invalid imagecreatefromgd2part() parameters)
?>
--FILE--
<?php
+require __DIR__ . '/func.inc';
+
$file = __DIR__ . '/bug38212私はガラスを食べられます.gd2';
$im1 = imagecreatetruecolor(10,100);
imagefill($im1, 0,0, 0xffffff);
imagegd2($im1, $file);
-$im = imagecreatefromgd2part($file, 0,0, -25,10);
+
+trycatch_dump(
+ fn() => imagecreatefromgd2part($file, 0,0, -25, 10),
+ fn() => imagecreatefromgd2part($file, 0,0, 10, -25)
+);
+
unlink($file);
?>
---EXPECTF--
-Warning: imagecreatefromgd2part(): Zero width or height not allowed in %s on line %d
+--EXPECT--
+!! [ValueError] Width must be at least 1
+!! [ValueError] Height must be at least 1