diff options
author | Filippos Karapetis | 2012-10-22 12:47:28 +0300 |
---|---|---|
committer | Filippos Karapetis | 2012-10-22 12:47:28 +0300 |
commit | 1286710248730db63149169c8e482f633fa9ccad (patch) | |
tree | 78bfc3f890048d16362f2bae7a1b8c034fa91db4 /engines/sci/sound | |
parent | bcf41fa7d23f804a0939b9a19f23100f05ef330b (diff) | |
download | scummvm-rg350-1286710248730db63149169c8e482f633fa9ccad.tar.gz scummvm-rg350-1286710248730db63149169c8e482f633fa9ccad.tar.bz2 scummvm-rg350-1286710248730db63149169c8e482f633fa9ccad.zip |
SCI: Fix bug #3578335 - "SCI: Mixed-Up Mother Goose EGA - crash upon choosing kid"
In several SCI0 games, the parameter to kDoSoundFade can be null.
We handle that case, instead of adding individual workarounds per game
Diffstat (limited to 'engines/sci/sound')
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index 5d32f40f18..7782ab4e48 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -340,6 +340,12 @@ reg_t SoundCommandParser::kDoSoundMasterVolume(int argc, reg_t *argv, reg_t acc) reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) { reg_t obj = argv[0]; + // The object can be null in several SCI0 games (e.g. Camelot, KQ1, KQ4, MUMG). + // Check bugs #3035149, #3036942 and #3578335. + // In this case, we just ignore the call. + if (obj.isNull() && argc == 1) + return acc; + MusicEntry *musicSlot = _music->getSlot(obj); if (!musicSlot) { debugC(kDebugLevelSound, "kDoSound(fade): Slot not found (%04x:%04x)", PRINT_REG(obj)); |