Skip to content

Commit

Permalink
fix logic bug in ogg and opus loop code (bug #4904)
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Dec 18, 2019
1 parent 9000cb9 commit d84d66b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/codecs/music_ogg.c
Expand Up @@ -336,7 +336,7 @@ static void *OGG_CreateFromRW(SDL_RWops *src, int freesrc)

full_length = vorbis.ov_pcm_total(&music->vf, -1);
if (((music->loop_start >= 0) || (music->loop_end > 0)) &&
((music->loop_start < music->loop_end) || (music->loop_end == 0)) &&
((music->loop_start < music->loop_end) || (music->loop_end > 0)) &&
(music->loop_start < full_length) &&
(music->loop_end <= full_length)) {
if (music->loop_start < 0) music->loop_start = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/codecs/music_opus.c
Expand Up @@ -332,7 +332,7 @@ static void *OPUS_CreateFromRW(SDL_RWops *src, int freesrc)

full_length = opus.op_pcm_total(music->of, -1);
if (((music->loop_start >= 0) || (music->loop_end > 0)) &&
((music->loop_start < music->loop_end) || (music->loop_end == 0)) &&
((music->loop_start < music->loop_end) || (music->loop_end > 0)) &&
(music->loop_start < full_length) &&
(music->loop_end <= full_length)) {
if (music->loop_start < 0) music->loop_start = 0;
Expand Down

0 comments on commit d84d66b

Please sign in to comment.