Fixed memory overrun bug in gdImageScaleTwoPass
Chris Reuter
Branch: suetanvil/gd-libgd:suetanvil
Branch: libgd/gd-libgd:master
Merged
Merged pull request
Merged in suetanvil/gd-libgd/suetanvil (pull request #12)
Merged in suetanvil/gd-libgd/suetanvil (pull request #12)
_gdContributionsCalc() would compute a window size and then adjust the left and right positions of the window to make a window within that size. However, it was storing the values in the struct before it made the adjustment, causing the rescale operation to read past the end of the array of weights. This change fixes that.