Skip to content

Commit

Permalink
Fix off-by-one error for the loop end
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat authored and coelckers committed Apr 23, 2017
1 parent fe2864d commit 4b78344
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sound/oalsound.cpp
Expand Up @@ -1283,7 +1283,7 @@ std::pair<SoundHandle,bool> OpenALSoundRenderer::LoadSound(uint8_t *sfxdata, int
if (!startass) loop_start = Scale(loop_start, srate, 1000);
if (!endass) loop_end = Scale(loop_end, srate, 1000);
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)
{
Expand Down

0 comments on commit 4b78344

Please sign in to comment.