Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
gdImageLine may misbehave or enter infinite loop if anti-aliasing is used and image size > 32768 #5
Please look at the following piece of code:
The function gdImageLine seems to never return, if at least one of the coordinates is over 32768 and anti-aliasing is used.
With coordinates different from the above example, the function may return, but the line drawn is still incorrect.
This problem was originally reported to gnuplot (bug no. 3377536), but I was able to isolate it.
gd version: 2.0.36
@line 3716 src/gd.c
//infinite loop here
Here is the piece of code run to check both algo give same result
Current implemented solution is to use 2 values, both in int32 range.
@pierrejoye : yes I think a switch to int64 will make code more legible, more consistent, easier to maintain, especially as most of us now works on 64bits OS.