From 72fd923cf5b714f5905b9f01547dc421ce7a1eb4 Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Sun, 19 Aug 2007 23:28:38 +0000 Subject: 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 --- engines/agi/sound.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/agi/sound.cpp') 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]; -- cgit v1.2.3