diff options
author | Paul Gilbert | 2018-04-09 21:20:40 -0400 |
---|---|---|
committer | Paul Gilbert | 2018-04-09 21:20:40 -0400 |
commit | efb1f9219cf26835c7e5a7ab2e32a7fadeb31a96 (patch) | |
tree | 09920d09391b3dcea17491795ac6d32ca03b0645 /engines/xeen/sound_driver.cpp | |
parent | 083f18af933bb528b6388a2814aa44a97a56e27b (diff) | |
download | scummvm-rg350-efb1f9219cf26835c7e5a7ab2e32a7fadeb31a96.tar.gz scummvm-rg350-efb1f9219cf26835c7e5a7ab2e32a7fadeb31a96.tar.bz2 scummvm-rg350-efb1f9219cf26835c7e5a7ab2e32a7fadeb31a96.zip |
XEEN: Add warning for invalid cmdFreezeFrequency channel values
I got a crash once for an invalid channel when falling to the
Water Elemental Plain from the Dark Side Skyroads, but couldn't
replicate it. So I've put in a warning for now
Diffstat (limited to 'engines/xeen/sound_driver.cpp')
-rw-r--r-- | engines/xeen/sound_driver.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/xeen/sound_driver.cpp b/engines/xeen/sound_driver.cpp index e79fcdd501..6ce10d9641 100644 --- a/engines/xeen/sound_driver.cpp +++ b/engines/xeen/sound_driver.cpp @@ -126,7 +126,10 @@ bool SoundDriver::musSkipWord(const byte *&srcP, byte param) { bool SoundDriver::cmdFreezeFrequency(const byte *&srcP, byte param) { debugC(3, kDebugSound, "cmdFreezeFrequency %d", param); - _channels[param]._changeFrequency = false; + if (param >= _channels.size()) + warning("Invalid channel %d in cmdFreezeFrequency call", param); + else + _channels[param]._changeFrequency = false; return false; } |