diff options
author | Travis Howell | 2005-02-14 10:02:34 +0000 |
---|---|---|
committer | Travis Howell | 2005-02-14 10:02:34 +0000 |
commit | 0e1a22729b168e284778b23ac72389895453438b (patch) | |
tree | 9d23aedd028d5b00bcd96565d2677a39ed6939ce | |
parent | a8520f4fe60b66b8793d5f237d6cb7b40bddaa66 (diff) | |
download | scummvm-rg350-0e1a22729b168e284778b23ac72389895453438b.tar.gz scummvm-rg350-0e1a22729b168e284778b23ac72389895453438b.tar.bz2 scummvm-rg350-0e1a22729b168e284778b23ac72389895453438b.zip |
Correct sound TAG for Backyard sports games
Fix memory leak.
svn-id: r16789
-rw-r--r-- | scumm/sound.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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); |