- Fixed: FMODSoundRenderer::DrawWaveDebug() only allocated enough space for the wavearray based

on the window_size, so for large numbers of output channels, it would not allocate enough
  space for the spectrum data (which is definied by SPECTRUM_SIZE, not the window_size) and
  write junk on the stack when drawing the spectrums, causing a crash.

SVN r3087 (trunk)
This commit is contained in:
Randy Heit 2011-01-02 18:11:48 +00:00
parent 2add3fb381
commit 869b9c9ccc
1 changed files with 1 additions and 1 deletions

View File

@ -2555,7 +2555,7 @@ void FMODSoundRenderer::DrawWaveDebug(int mode)
// 16 pixels of padding between each window.
window_size = (screen->GetWidth() - 16) / numoutchans - 16;
float *wavearray = (float*)alloca(window_size*sizeof(float));
float *wavearray = (float*)alloca(MAX(SPECTRUM_SIZE,window_size)*sizeof(float));
y = 16;
y = DrawChannelGroupOutput(SfxGroup, wavearray, window_size, window_height, y, mode);