diff options
author | Filippos Karapetis | 2010-01-02 13:36:12 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-01-02 13:36:12 +0000 |
commit | 5b4b8e053fd6bbad8a5f96dfdfa26568dc3fd026 (patch) | |
tree | 7d631f5dc0c0cc730007ea43d29921d363064ee8 | |
parent | d4dda4df831e3772d2ed5c134bafb2ae07c3eb47 (diff) | |
download | scummvm-rg350-5b4b8e053fd6bbad8a5f96dfdfa26568dc3fd026.tar.gz scummvm-rg350-5b4b8e053fd6bbad8a5f96dfdfa26568dc3fd026.tar.bz2 scummvm-rg350-5b4b8e053fd6bbad8a5f96dfdfa26568dc3fd026.zip |
SCI/new music code: Fix for a music related crash in SCI0 games (the sound object can get deleted while polling it)
svn-id: r46881
-rw-r--r-- | engines/sci/sfx/soundcmd.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp index 76b7e68e00..e7aa84d915 100644 --- a/engines/sci/sfx/soundcmd.cpp +++ b/engines/sci/sfx/soundcmd.cpp @@ -768,6 +768,13 @@ void SoundCommandParser::cmdUpdateCues(reg_t obj, int16 value) { } _music->_mutex.unlock(); // unlock to perform mixer-related calls + // In SCI0, make absolutely sure that the sound object hasn't + // been deleted (can happen e.g. at the ending of QFG1) + if (_soundVersion <= SCI_VERSION_0_LATE) { + if (!_segMan->getObject(musicSlot->soundObj)) + return; + } + // Update digital sound effect slots here Audio::Mixer *mixer = g_system->getMixer(); |