mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 09:28:15 +03: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:
@@ -163,6 +163,12 @@ void musicclass::play(int t, const double position_sec /*= 0.0*/, const int fade
|
|||||||
if (t != -1)
|
if (t != -1)
|
||||||
{
|
{
|
||||||
currentsong = t;
|
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)))
|
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
|
// Level Complete theme, no fade in or repeat
|
||||||
|
|||||||
Reference in New Issue
Block a user