summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2007-06-14 19:17:31 +0000
committerPierre Joye <pajoye@php.net>2007-06-14 19:17:31 +0000
commitf5f04f22148cd1fe4238aa22cc47fa8a36d3194f (patch)
tree8d7c5ccc773f90af9bea2d93a31f313d7c7a32f8
parentc73237b7b9d5a54256a64f2ca09577cb82e80554 (diff)
downloadphp-git-f5f04f22148cd1fe4238aa22cc47fa8a36d3194f.tar.gz
- Fixed regression introduced by the fix for the libgd bug #74
-rw-r--r--NEWS1
-rw-r--r--ext/gd/libgd/gd.c34
2 files changed, 23 insertions, 12 deletions
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;