Skip to content
Permalink
Browse files

Fix for buffer overflow in audio code, when feeding a device that needs

 resampling.

Fixes Bugzilla #298.
  • Loading branch information
icculus committed Oct 27, 2006
1 parent 61ea678 commit b9b1b4d868de5ddead951f40a29c8cdbc3a8fe73
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/audio/SDL_audio.c
@@ -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 ) {

0 comments on commit b9b1b4d

Please sign in to comment.