From 60a115b0a75e7677158ccc53479945e4e11be854 Mon Sep 17 00:00:00 2001 From: ilag11111 Date: Fri, 25 Apr 2014 00:37:13 -0700 Subject: [PATCH] Fix (Linux) 64-bit crash in CEZ3 (playback of sfx_litng3). --- src/sdl/mixer_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 6888331de..84003a87c 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -152,7 +152,7 @@ static Mix_Chunk *ds2chunk(void *stream) if (!(frac & 0xFFFF)) // other solid multiples (change if FRACBITS != 16) newsamples = samples * (frac >> FRACBITS); else // strange and unusual fractional frequency steps, plus anything higher than 44100hz. - newsamples = FixedMul(frac, samples) + 1; // add 1 sample for security! the code below rounds up. + newsamples = FixedMul(frac, samples) + 2; // add 2 samples for security! the code below rounds up. if (newsamples >= UINT32_MAX>>2) return NULL; // would and/or did wrap, can't store. break;