Fix #440: new_width & new_height exception handling

Since the cos range is a real number range, there is a possibility of negative numbers.
- handling fabs new_width & new_height
master
Haegul Pyun 2018-04-18 14:45:51 +09:00 committed by Christoph M. Becker
parent d9157ebb08
commit 6653f3b535
1 changed files with 2 additions and 2 deletions

View File

@ -60,9 +60,9 @@ int main(int argc, char **arg)
/* to radian */
a2 = angle * .0174532925;
new_width = ceil(cos(a2) * gdImageSX(im)) +
new_width = fabs(ceil(cos(a2) * gdImageSX(im))) +
fabs(sin(a2) * gdImageSY(im));
new_height = ceil(cos(a2) * gdImageSY(im)) +
new_height = fabs(ceil(cos(a2) * gdImageSY(im))) +
fabs(sin(a2) * gdImageSX(im));