Commits

Ondřej Surý  committed bc70152

Cherry-pick php-libgd fixes for imagefill() doesn't work correctly for small images

  • Participants
  • Parent commits ba8f21a

Comments (0)

Files changed (1)

 	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;
 	}