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

diff --git a/NEWS b/NEWS
index 22db2104ac404ffc9328365277c19073c8f86d71..cd6f7612d6663e1ec57c2af7cfa86acf51d3fd04 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -27,8 +27,10 @@ PHP                                                                        NEWS
          colors (Rob Leslie)
   . Improved thread safety of the gif support (Roman Nemecek, Nuno, Pierre)
        . Use the dimension of the GIF frame to create the destination image (Pierre)
-       . Load only once the local color map (Pierre)
+       . Load only once the local color map from a GIF data (Pierre)
   . Improved thread safety of the freetype cache (Scott MacVicar, Nuno, Pierre)
+       . imagearc huge CPU usage with large angles (Pierre)
+
 - Upgraded libraries bundled in the Windows distribution. (Edin)
   . c-client (imap) to version 2006e
   . libpq (PostgreSQL) to version 8.2.3
index 8fae6245fac12ce45f68c72510c5fb52ac2418ef..4901594b70c3b91595dbee75be1340254d39d1c0 100644 (file)
@@ -1645,6 +1645,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;
        }