Improved version of the fix. Also remove a regression present in the previous version.
--- libgd2-2.0.33-5.2-patched/gd.c 2007-05-15 19:44:43.000000000 +0200 +++ libgd2-2.0.33-5.2-patched-fx/gd.c 2007-06-21 14:33:53.000000000 +0200 @@ -1513,10 +1513,31 @@ BGD_DECLARE(void) gdImageFilledArc (gdIm int i; int lx = 0, ly = 0; int fx = 0, fy = 0; - while (e < s) - { - e += 360; - } + + if ((s % 360) == (e % 360)) { + s = 0; e = 360; + } else { + if (s > 360) { + s = s % 360; + } + + if (e > 360) { + e = 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;