]> granicus.if.org Git - php/commitdiff
- Fixed bug in gdImageFilledRectangle in the bundled GD library, that required
authorDerick Rethans <derick@php.net>
Tue, 2 Mar 2004 21:56:30 +0000 (21:56 +0000)
committerDerick Rethans <derick@php.net>
Tue, 2 Mar 2004 21:56:30 +0000 (21:56 +0000)
  x1 < x2 and y1 < y2 for coordinates.

NEWS
ext/gd/libgd/gd.c

diff --git a/NEWS b/NEWS
index 147bcd9a0f42033d89995703cc5773c22ad0a5a8..d6b16a7e7326fd26f2ab86e71f6258a000acc591 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ PHP                                                                        NEWS
 - Methods that override parent methods are now subject to prototype checking,
   and have to be compatible with the method they're overriding - this check is 
   disabled in compatibility mode. (Andi, Zeev)
+- Fixed bug in gdImageFilledRectangle in the bundled GD library, that required
+  x1 < x2 and y1 < y2 for coordinates. (Derick)
 - Fixed crash with foreach() and temporary objects($obj->method()->a ...) where
   method returns a non-referenced object. (Andi, Zeev)
 - Fixed problem preventing startup errors from being displayed. (Marcus)
index 5b798fad4c08c3a2c702ee2f72a283a09e2df181..1459f4cb5f74a94e4e951b0423d11b8e0b610367 100644 (file)
@@ -2038,6 +2038,16 @@ void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int
        if (y1 > gdImageSY(im)) {
                y1 = gdImageSY(im);
        }
+       if (x1 > x2) {
+               x = x1;
+               x1 = x2;
+               x2 = x;
+       }
+       if (y1 > y2) {
+               y = y1;
+               y1 = y2;
+               y2 = y;
+       }
 
        for (y = y1; (y <= y2); y++) {
                for (x = x1; (x <= x2); x++) {