aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorJames Brown2002-05-09 18:03:07 +0000
committerJames Brown2002-05-09 18:03:07 +0000
commitceb97152c75a2b147e1cee89c053b57866730f61 (patch)
tree49d9707049e91036bc83def63940f785a5c379d1 /sound
parent12c2318c769cc506df1c37d193823054e8cce60c (diff)
downloadscummvm-rg350-ceb97152c75a2b147e1cee89c053b57866730f61.tar.gz
scummvm-rg350-ceb97152c75a2b147e1cee89c053b57866730f61.tar.bz2
scummvm-rg350-ceb97152c75a2b147e1cee89c053b57866730f61.zip
Fix odd Sam and Max iMUSE crash. Thread syncronisation bug?
svn-id: r4256
Diffstat (limited to 'sound')
-rw-r--r--sound/imuse.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/imuse.cpp b/sound/imuse.cpp
index 70a1ff3508..511c7a1a41 100644
--- a/sound/imuse.cpp
+++ b/sound/imuse.cpp
@@ -4411,6 +4411,13 @@ void IMuseGM::part_changed(Part *part, byte what)
if (!(mc = part->_mc->gm()))
return;
+ if (part->_player == NULL) { /* No player, so dump phantom channel */
+ part->_mc = NULL;
+ mc->_part = NULL;
+ memset(mc->_actives, 0, sizeof(mc->_actives));
+ return;
+ }
+
if (what & pcMod)
midiPitchBend(mc->_chan,
clamp(part->_pitchbend + part->_detune_eff +