Cherry-pick php-libgd fixes for imagefill() doesn't work correctly for small images
parent
ba8f21afb5
commit
bc70152cd8
24
src/gd.c
24
src/gd.c
|
@ -1991,21 +1991,15 @@ BGD_DECLARE(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);
|
||||
} while(ix++ < (im->sx -1));
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue