mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-08 18:09:45 +01:00
Add bounds check to musicclass::play()
If the song number (after we've processed it) is out-of-bounds, then just return and log the error.
This commit is contained in:
parent
7c2b418761
commit
5fe3b9d0de
1 changed files with 6 additions and 0 deletions
|
@ -163,6 +163,12 @@ void musicclass::play(int t, const double position_sec /*= 0.0*/, const int fade
|
|||
if (t != -1)
|
||||
{
|
||||
currentsong = t;
|
||||
if (!INBOUNDS(t, musicTracks))
|
||||
{
|
||||
puts("play() out-of-bounds!");
|
||||
currentsong = -1;
|
||||
return;
|
||||
}
|
||||
if (currentsong == 0 || currentsong == 7 || (!map.custommode && (currentsong == 0+num_pppppp_tracks || currentsong == 7+num_pppppp_tracks)))
|
||||
{
|
||||
// Level Complete theme, no fade in or repeat
|
||||
|
|
Loading…
Reference in a new issue