-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #66387: Stack overflow with imagefilltoborder
The stack overflow is caused by the recursive algorithm in combination with a very large negative coordinate passed to gdImageFillToBorder(). As there is already a clipping for large positive coordinates to the width and height of the image, it seems to be consequent to clip to zero also.
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--TEST-- | ||
Bug #66387 (Stack overflow with imagefilltoborder) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('gd')) die('skip gd extension not available!'); | ||
?> | ||
--FILE-- | ||
<?php | ||
$im = imagecreatetruecolor(20, 20); | ||
$c = imagecolorallocate($im, 255, 0, 0); | ||
imagefilltoborder($im, 0, -999355, $c, $c); | ||
echo "ready\n"; | ||
?> | ||
--EXPECT-- | ||
ready |