Fix for buffer overflow in audio code, when feeding a device that needs
resampling. Fixes Bugzilla #298. --HG-- branch : SDL-1.2 extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402200
This commit is contained in:
parent
0a1cd99daf
commit
fce9244441
1 changed files with 2 additions and 1 deletions
|
@ -590,7 +590,8 @@ int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained)
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
if ( audio->convert.needed ) {
|
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.buf =(Uint8 *)SDL_AllocAudioMem(
|
||||||
audio->convert.len*audio->convert.len_mult);
|
audio->convert.len*audio->convert.len_mult);
|
||||||
if ( audio->convert.buf == NULL ) {
|
if ( audio->convert.buf == NULL ) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue