From: Pierre Joye Date: Thu, 14 Jun 2007 19:17:31 +0000 (+0000) Subject: - Fixed regression introduced by the fix for the libgd bug #74 X-Git-Tag: php-5.2.4RC1~350 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5f04f22148cd1fe4238aa22cc47fa8a36d3194f;p=php - Fixed regression introduced by the fix for the libgd bug #74 --- diff --git a/NEWS b/NEWS index dde2a9137b..553c72c649 100644 --- 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) diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 17d4594c84..c78b16b441 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -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;