From: Pierre Joye Date: Thu, 28 Sep 2006 08:52:23 +0000 (+0000) Subject: - MFB: imagefill(), infinite loop with wrong color index X-Git-Tag: RELEASE_1_0_0RC1~1527 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66cd47d5e91fb45adf41ea9ad6f444738d894aec;p=php - MFB: imagefill(), infinite loop with wrong color index --- diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 5f2d36f68f..14dcc110c7 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -1914,6 +1914,10 @@ void gdImageFill(gdImagePtr im, int x, int y, int nc) struct seg *stack; struct seg *sp; + if (!im->trueColor && nc > (im->colorsTotal -1)) { + return; + } + alphablending_bak = im->alphaBlendingFlag; im->alphaBlendingFlag = 0; diff --git a/ext/gd/tests/imagefill_1.phpt b/ext/gd/tests/imagefill_1.phpt new file mode 100644 index 0000000000..04e1cab55a --- /dev/null +++ b/ext/gd/tests/imagefill_1.phpt @@ -0,0 +1,25 @@ +--TEST-- +imagefill() infinite loop with wrong color index +--SKIPIF-- + +--FILE-- + +--EXPECT-- +00