fix logic bug in ogg and opus loop code (bug #4904)
authorOzkan Sezer
Wed, 18 Dec 2019 17:55:50 +0300
changeset 10965ad7d1e1ddaa
parent 1095 0bb640cdd4ed
child 1097 b8a083ebef5f
fix logic bug in ogg and opus loop code (bug #4904)
src/codecs/music_ogg.c
src/codecs/music_opus.c
     1.1 --- a/src/codecs/music_ogg.c	Wed Dec 18 15:51:56 2019 +0300
     1.2 +++ b/src/codecs/music_ogg.c	Wed Dec 18 17:55:50 2019 +0300
     1.3 @@ -336,7 +336,7 @@
     1.4  
     1.5      full_length = vorbis.ov_pcm_total(&music->vf, -1);
     1.6      if (((music->loop_start >= 0) || (music->loop_end > 0)) &&
     1.7 -        ((music->loop_start < music->loop_end) || (music->loop_end == 0)) &&
     1.8 +        ((music->loop_start < music->loop_end) || (music->loop_end > 0)) &&
     1.9           (music->loop_start < full_length) &&
    1.10           (music->loop_end <= full_length)) {
    1.11          if (music->loop_start < 0) music->loop_start = 0;
     2.1 --- a/src/codecs/music_opus.c	Wed Dec 18 15:51:56 2019 +0300
     2.2 +++ b/src/codecs/music_opus.c	Wed Dec 18 17:55:50 2019 +0300
     2.3 @@ -332,7 +332,7 @@
     2.4  
     2.5      full_length = opus.op_pcm_total(music->of, -1);
     2.6      if (((music->loop_start >= 0) || (music->loop_end > 0)) &&
     2.7 -        ((music->loop_start < music->loop_end) || (music->loop_end == 0)) &&
     2.8 +        ((music->loop_start < music->loop_end) || (music->loop_end > 0)) &&
     2.9           (music->loop_start < full_length) &&
    2.10           (music->loop_end <= full_length)) {
    2.11          if (music->loop_start < 0) music->loop_start = 0;