mirror of
https://github.com/yawut/SDL.git
synced 2026-04-26 00:57:36 -05:00
Fix for buffer overflow in audio code, when feeding a device that needs
resampling. Fixes Bugzilla #298. --HG-- branch : SDL-1.2
This commit is contained in:
parent
b133717f80
commit
106664a5ec
|
|
@ -590,7 +590,8 @@ int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained)
|
|||
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 ) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user