Fix for buffer overflow in audio code, when feeding a device that needs
resampling.
Fixes Bugzilla #298.
--- a/src/audio/SDL_audio.c Sat Oct 21 18:53:33 2006 +0000
+++ b/src/audio/SDL_audio.c Fri Oct 27 20:18:24 2006 +0000
@@ -590,7 +590,8 @@
return(-1);
}
if ( audio->convert.needed ) {
- audio->convert.len = desired->size;
+ audio->convert.len = (int) ( ((double) desired->size) /
+ audio->convert.len_ratio );
audio->convert.buf =(Uint8 *)SDL_AllocAudioMem(
audio->convert.len*audio->convert.len_mult);
if ( audio->convert.buf == NULL ) {