Skip to content

Commit

Permalink
Fix for buffer overflow in audio code, when feeding a device that needs
Browse files Browse the repository at this point in the history
 resampling.

Fixes Bugzilla #298.
  • Loading branch information
icculus committed Oct 27, 2006
1 parent 61ea678 commit b9b1b4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/audio/SDL_audio.c
Expand Up @@ -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 ) {
Expand Down

0 comments on commit b9b1b4d

Please sign in to comment.