From 0e1a22729b168e284778b23ac72389895453438b Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Mon, 14 Feb 2005 10:02:34 +0000 Subject: Correct sound TAG for Backyard sports games Fix memory leak. svn-id: r16789 --- scumm/sound.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 6b5167167a..5f1e51d5a1 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -546,6 +546,10 @@ void Sound::playSound(int soundID, int heOffset, int heChannel, int heFlags) { _vm->_musicEngine->startSound(soundID); } } + + + if (soundID > _vm->_numSounds) + delete ptr; } void Sound::processSfxQueues() { @@ -1307,7 +1311,7 @@ int ScummEngine::readSoundResource(int type, int idx) { total_size = _fileHandle.readUint32BE(); _fileHandle.read(createResource(type, idx, total_size), total_size - 8); return 1; - } else if (basetag == MKID('WSOU')) { + } else if (basetag == MKID('RIFF')) { _fileHandle.seek(-12, SEEK_CUR); total_size = _fileHandle.readUint32BE(); _fileHandle.read(createResource(type, idx, total_size), total_size - 8); -- cgit v1.2.3