]> granicus.if.org Git - php/commitdiff
- Fixed regression introduced by the fix for the libgd bug #74
authorPierre Joye <pajoye@php.net>
Thu, 14 Jun 2007 19:17:31 +0000 (19:17 +0000)
committerPierre Joye <pajoye@php.net>
Thu, 14 Jun 2007 19:17:31 +0000 (19:17 +0000)
NEWS
ext/gd/libgd/gd.c

diff --git a/NEWS b/NEWS
index dde2a9137b9ff0c5a5d384383627752c4e09f92d..553c72c649466799383df64d9ba8a7677e99a35d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ PHP                                                                        NEWS
 - Added missing format validator to unpack() function. (Ilia)
 - Added missing error check inside bcpowmod(). (Ilia)
 
+- Fixed regression introduced by the fix for the libgd bug #74 (Pierre)
 - Fixed several integer overflows in ImageCreate(), ImageCreateTrueColor(), 
   ImageCopyResampled() and ImageFilledPolygon() reported by Mattias Bengtsson. 
   (Tony)
index 17d4594c846be42114bd0d3f21095efa16e149ae..c78b16b4410d465011b4cb2cf467278e0f920c33 100644 (file)
@@ -1667,21 +1667,30 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e
        int lx = 0, ly = 0;
        int fx = 0, fy = 0;
 
-       if (s > 360) {
-               s = s % 360;
-       }
 
-       if (e > 360) {
-               e = e % 360;
-       }
+    if ((s % 360)  == (e % 360)) {
+               s = 0; e = 360;
+    } else {
+        if (s > 360) {
+            s = s % 360;
+        }
 
-       while (s<0) {
-               s += 360;
-       }
+        if (e > 360) {
+            e = e % 360;
+        }
 
-       while (e < s) {
-               e += 360;
-       }
+        while (s < 0) {
+            s += 360;
+        }
+
+        while (e < s) {
+            e += 360;
+        }
+
+        if (s == e) {
+                       s = 0; e = 360;
+        }
+    }
 
        for (i = s; i <= e; i++) {
                int x, y;
@@ -2531,6 +2540,7 @@ void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, i
 {
        int x, y;
        double sy1, sy2, sx1, sx2;
+
        if (!dst->trueColor) {
                gdImageCopyResized (dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH);
                return;