Fix off-by-one error for the loop end

This commit is contained in:
Chris Robinson 2017-04-22 14:55:41 -07:00 committed by Christoph Oelckers
parent fe2864d396
commit 4b7834465b
1 changed files with 1 additions and 1 deletions

View File

@ -1283,7 +1283,7 @@ std::pair<SoundHandle,bool> OpenALSoundRenderer::LoadSound(uint8_t *sfxdata, int
if (!startass) loop_start = Scale(loop_start, srate, 1000); if (!startass) loop_start = Scale(loop_start, srate, 1000);
if (!endass) loop_end = Scale(loop_end, srate, 1000); if (!endass) loop_end = Scale(loop_end, srate, 1000);
if (loop_start < 0) loop_start = 0; if (loop_start < 0) loop_start = 0;
if (loop_end >= data.Size() / samplesize) loop_end = data.Size() / samplesize - 1; if (loop_end > data.Size() / samplesize) loop_end = data.Size() / samplesize;
if ((loop_start > 0 || loop_end > 0) && loop_end > loop_start && AL.SOFT_loop_points) if ((loop_start > 0 || loop_end > 0) && loop_end > loop_start && AL.SOFT_loop_points)
{ {