]> granicus.if.org Git - php/commitdiff
- libgd #74, gdImageFilledArc, huge CPU usage with large angles
authorPierre Joye <pajoye@php.net>
Sat, 14 Apr 2007 17:30:51 +0000 (17:30 +0000)
committerPierre Joye <pajoye@php.net>
Sat, 14 Apr 2007 17:30:51 +0000 (17:30 +0000)
ext/gd/libgd/gd.c

index 6cf29ba1df5ec95c62fa154bcc5239b56ca8fa2e..ea4cdf7614ef84e5bd1a6e810e2592fb687c3051 100644 (file)
@@ -1643,6 +1643,14 @@ 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;
+       }
+
        while (s<0) {
                s += 360;
        }