aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorKari Salminen2007-08-19 23:28:38 +0000
committerKari Salminen2007-08-19 23:28:38 +0000
commit72fd923cf5b714f5905b9f01547dc421ce7a1eb4 (patch)
tree1b0c3b00981ac92ae1f55fd41226c393631febf9 /engines
parent5b711795d06d9f8dc2dada2e6e41e25a625de502 (diff)
downloadscummvm-rg350-72fd923cf5b714f5905b9f01547dc421ce7a1eb4.tar.gz
scummvm-rg350-72fd923cf5b714f5905b9f01547dc421ce7a1eb4.tar.bz2
scummvm-rg350-72fd923cf5b714f5905b9f01547dc421ce7a1eb4.zip
Fixes previously crashing sound. Crash happened because of PCjr 4-channel mixing code trying to use uninitialized values (phase, ins etc) when mixSound was called before anything was playing.
svn-id: r28672
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/sound.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp
index 5c19a3b55a..c06921c4ae 100644
--- a/engines/agi/sound.cpp
+++ b/engines/agi/sound.cpp
@@ -663,6 +663,9 @@ uint32 SoundMgr::mixSound(void) {
memset(_sndBuffer, 0, BUFFER_SIZE << 1);
+ if (!_playing || _playingSound == -1)
+ return BUFFER_SIZE;
+
// Handle Apple IIGS sound mixing here
if (_vm->_soundemu == SOUND_EMU_APPLE2GS && _playing && _playingSound != -1) {
//IIgsWaveInfo &waveInfo = _IIgsChannel.ins.oscList(0).waves[0];