Skip to content

Commit 5d40953

Browse files
committed
add test
1 parent ccd34f4 commit 5d40953

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

ext/gd/tests/gh20551.phpt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
GH-20551: (imagegammacorrect out of range input/output value)
3+
--EXTENSIONS--
4+
gd
5+
--FILE--
6+
<?php
7+
$im = imagecreate(64, 32);
8+
9+
try {
10+
imagegammacorrect($im, NAN, 1.0);
11+
} catch (\ValueError $e) {
12+
echo $e->getMessage(), PHP_EOL;
13+
}
14+
try {
15+
imagegammacorrect($im, -NAN, 1.0);
16+
} catch (\ValueError $e) {
17+
echo $e->getMessage(), PHP_EOL;
18+
}
19+
?>
20+
--EXPECT--
21+
An input divided by an output must be finite
22+
An input divided by an output must be finite

0 commit comments

Comments
 (0)