From: Florian Anderiasch Date: Tue, 1 Nov 2011 11:51:53 +0000 (+0000) Subject: Fixed #60160 and added a test for it X-Git-Tag: php-5.5.0alpha1~957 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=be930868aacdd12b8487457c62dd48dfcb00defb;p=php Fixed #60160 and added a test for it --- diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 0cc2e1d7de..fa75898ddb 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -1894,19 +1894,14 @@ void gdImageFill(gdImagePtr im, int x, int y, int nc) if (im->sx < 4) { int ix = x, iy = y, c; do { - c = gdImageGetPixel(im, ix, iy); - if (c != oc) { - goto done; - } - gdImageSetPixel(im, ix, iy, nc); - } while(ix++ < (im->sx -1)); - ix = x; iy = y + 1; - do { - c = gdImageGetPixel(im, ix, iy); - if (c != oc) { - goto done; - } - gdImageSetPixel(im, ix, iy, nc); + do { + c = gdImageGetPixel(im, ix, iy); + if (c != oc) { + goto done; + } + gdImageSetPixel(im, ix, iy, nc); + } while(ix++ < (im->sx -1)); + ix = x; } while(iy++ < (im->sy -1)); goto done; } diff --git a/ext/gd/tests/bug60160.phpt b/ext/gd/tests/bug60160.phpt new file mode 100644 index 0000000000..af2df41820 --- /dev/null +++ b/ext/gd/tests/bug60160.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #60160 (imagefill does not work correctly for small images) @see bug51671 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +OK