php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch fix-imagefill-for-images-smaller-than-4px-width for GD related Bug #60160

Patch version 2011-10-31 14:51 UTC

Return to Bug #60160 | Download this patch
Patch Revisions:

Developer: fa@php.net

Index: ext/gd/libgd/gd.c
===================================================================
--- ext/gd/libgd/gd.c	(revision 318603)
+++ ext/gd/libgd/gd.c	(working copy)
@@ -1894,19 +1894,14 @@
 	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;
 	}
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 23 18:01:55 2014 UTC