Skip to content

Commit

Permalink
audio: calculate resampling time directly, don't increment (thanks, E…
Browse files Browse the repository at this point in the history
…ric!).

Fixes buffer overruns as floating point errors accumulate.

Partially fixes Bugzilla #3848.
  • Loading branch information
icculus committed Oct 11, 2017
1 parent 763c387 commit b2f5123
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/audio/SDL_audiocvt.c
Expand Up @@ -527,7 +527,7 @@ SDL_ResampleAudio(const int chans, const int inrate, const int outrate,
*(dst++) = outsample;
}

outtime += outtimeincr;
outtime = i * outtimeincr;
}

return outframes * chans * sizeof (float);
Expand Down

0 comments on commit b2f5123

Please sign in to comment.