diff options
author | Travis Howell | 2006-03-19 04:41:43 +0000 |
---|---|---|
committer | Travis Howell | 2006-03-19 04:41:43 +0000 |
commit | 1b20b068220b30967cfdd290365014ab81c12a1f (patch) | |
tree | c414003780963523a694d6dbc69ebd518275d5dd /engines | |
parent | ead8cb480ab60246d9da46d1195cc6846376807a (diff) | |
download | scummvm-rg350-1b20b068220b30967cfdd290365014ab81c12a1f.tar.gz scummvm-rg350-1b20b068220b30967cfdd290365014ab81c12a1f.tar.bz2 scummvm-rg350-1b20b068220b30967cfdd290365014ab81c12a1f.zip |
Skip HSHD block by set size, since there are sound resources (ie Caiman in jungle) which have incorrect size in HSHD header
svn-id: r21373
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/he/sound_he.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp index e22ae699b2..5f162defb0 100644 --- a/engines/scumm/he/sound_he.cpp +++ b/engines/scumm/he/sound_he.cpp @@ -444,7 +444,9 @@ void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) { priority = (soundID > _vm->_numSounds) ? 255 : *(ptr + 18); rate = READ_LE_UINT16(ptr + 22); - ptr += 8 + READ_BE_UINT32(ptr + 12); + + // Skip DIGI/TALK (8) and HSHD (24) blocks + ptr += 32; if (_vm->_mixer->isSoundHandleActive(_heSoundChannels[heChannel])) { int curSnd = _heChannel[heChannel].sound; @@ -461,7 +463,7 @@ void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) { } assert(READ_BE_UINT32(ptr) == MKID_BE('SDAT')); - size = READ_BE_UINT32(ptr+4) - 8; + size = READ_BE_UINT32(ptr + 4) - 8; if (heOffset < 0 || heOffset > size) { // Occurs when making fireworks in puttmoon debug(0, "playSound: Invalid sound offset (offset %d, size %d) in sound %d", heOffset, size, soundID); @@ -489,10 +491,12 @@ void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) { else if (READ_BE_UINT32(ptr) == MKID_BE('MRAW')) { priority = *(ptr + 18); rate = READ_LE_UINT16(ptr + 22); - ptr += 8 + READ_BE_UINT32(ptr+12); + + // Skip DIGI (8) and HSHD (24) blocks + ptr += 32; assert(READ_BE_UINT32(ptr) == MKID_BE('SDAT')); - size = READ_BE_UINT32(ptr+4) - 8; + size = READ_BE_UINT32(ptr + 4) - 8; flags = Audio::Mixer::FLAG_AUTOFREE; |