diff options
author | Eugene Sandulenko | 2009-06-13 22:48:16 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2009-06-13 22:48:16 +0000 |
commit | d925104b6a5b66d4dc6093acdf2cf3cd952a709c (patch) | |
tree | f4c2f048d93560d03a55605c6c94309792146328 | |
parent | 51dd66817774aa1a05788df38db5a4ac349f4983 (diff) | |
download | scummvm-rg350-d925104b6a5b66d4dc6093acdf2cf3cd952a709c.tar.gz scummvm-rg350-d925104b6a5b66d4dc6093acdf2cf3cd952a709c.tar.bz2 scummvm-rg350-d925104b6a5b66d4dc6093acdf2cf3cd952a709c.zip |
Added sanity checking to stopSound() and a bit more debug output
svn-id: r41501
-rw-r--r-- | engines/agi/sound.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index b0856f6ddf..eabe2f1dba 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -411,6 +411,8 @@ void SoundMgr::startSound(int resnum, int flag) { void SoundMgr::stopSound() { int i; + debugC(3, kDebugLevelSound, "stopSound() --> %d", _playingSound); + _endflag = -1; if (_vm->_soundemu != SOUND_EMU_APPLE2GS) { for (i = 0; i < NUM_CHANNELS; i++) @@ -418,7 +420,8 @@ void SoundMgr::stopSound() { } if (_playingSound != -1) { - _vm->_game.sounds[_playingSound]->stop(); + if (_vm->_game.sounds[_playingSound]) // sanity checking + _vm->_game.sounds[_playingSound]->stop(); if (_vm->_soundemu == SOUND_EMU_APPLE2GS) { _gsSound.stopSounds(); |