Fix memory corruption in timidity resampling code.

From Sam Lantinga in SDL_mixer 1.2.8:
http://lists.libsdl.org/pipermail/commits-libsdl.org/2007-July/008673.html

Fixes a crash on OpenBSD.
This commit is contained in:
Jonathan Gray 2014-07-20 22:58:43 +10:00
parent 485edfebc1
commit 86216aa708

View file

@ -710,7 +710,7 @@ void pre_resample(Sample * sp)
while (--count)
{
vptr = src + (ofs >> FRACTION_BITS);
v1 = *(vptr - 1);
v1 = (vptr == src) ? *vptr : *(vptr - 1);
v2 = *vptr;
v3 = *(vptr + 1);
v4 = *(vptr + 2);