summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2007-10-20 15:29:04 +0000
committerPierre Joye <pajoye@php.net>2007-10-20 15:29:04 +0000
commit5ca87f290ce0eeafe82d695f6cdecffd152da7e2 (patch)
tree95a0903feb283678620753e3c27d0f9e97c3176e
parent0d9e4e7415d84d3b168b8010130b37eaf0dbab87 (diff)
downloadphp-git-5ca87f290ce0eeafe82d695f6cdecffd152da7e2.tar.gz
- #43010, Fixed regression in imagearc with two equivelent angles
-rw-r--r--NEWS2
-rw-r--r--ext/gd/libgd/gd.c30
2 files changed, 21 insertions, 11 deletions
diff --git a/NEWS b/NEWS
index 49bfdb5d4e..de8d0c2736 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,8 @@ PHP 4 NEWS
open_basedir or safe_mode is active (Stas)
- Fixed session.save_path and error_log values to be checked against
open_basedir and safe_mode (CVE-2007-3378) (Stas, Maksymilian Arciemowicz)
+- Fixed bug #43010 (Fixed regression in imagearc with two equivelent angles)
+ (Pierre)
- Fixed bug #41765 (Recode crashes/does not work on amd64)
(nexus at smoula dot net, Stas)
- Fixed bug #41630 (segfault when an invalid color index is present in
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index 78a3c03c6d..58079368b4 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -1607,20 +1607,28 @@ 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 ((s % 360) == (e % 360)) {
+ s = 0; e = 360;
+ } else {
+ if (s > 360) {
+ s = s % 360;
+ }
- if (e > 360) {
- e = e % 360;
- }
+ if (e > 360) {
+ e = e % 360;
+ }
- while (s<0) {
- s += 360;
- }
+ while (s < 0) {
+ s += 360;
+ }
- while (e < s) {
- e += 360;
+ while (e < s) {
+ e += 360;
+ }
+
+ if (s == e) {
+ s = 0; e = 360;
+ }
}
for (i = s; i <= e; i++) {