Skip to content

Commit 30b2af9

Browse files
committed
- MFH: Fix #28506, negative angle returns "random arcs"
while (s < 0) s += 360 is used now
1 parent 03edfa1 commit 30b2af9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ PHP 4 NEWS
1515
and/or HTTP_SESSION_VARS. (Sara)
1616
- Fixed bug #28508 (Do not make hypot() available if not supported by libc).
1717
(Ilia)
18+
- Fixed bug #28506 (Allow negative start angle in imagearc and imagefilledarc.
19+
(Pierre)
1820
- Fixed bug #28386 (wordwrap() wraps lines 1 character too soon). (Ilia)
1921
- Fixed bug #28374 (Possible unterminated loop inside
2022
_php_pgsql_trim_message()). (Ilia)

ext/gd/libgd/gd.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,9 +1607,14 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e
16071607
int lx = 0, ly = 0;
16081608
int fx = 0, fy = 0;
16091609

1610+
while (s<0) {
1611+
s += 360;
1612+
}
1613+
16101614
while (e < s) {
16111615
e += 360;
16121616
}
1617+
16131618
for (i = s; i <= e; i++) {
16141619
int x, y;
16151620
x = ((long) gdCosT[i % 360] * (long) w / (2 * 1024)) + cx;

0 commit comments

Comments
 (0)