diff options
| author | Gregory Montoir | 2007-11-23 18:19:32 +0000 |
|---|---|---|
| committer | Gregory Montoir | 2007-11-23 18:19:32 +0000 |
| commit | c38ccb18c7e4215ae49673b5c261fe3116461129 (patch) | |
| tree | 6cd2dcb30512a1de48af2ffee9d525eb8fa2f3fb | |
| parent | 402a3dbbe34e326ffffcef607be206a1a8818a7b (diff) | |
| download | scummvm-rg350-c38ccb18c7e4215ae49673b5c261fe3116461129.tar.gz scummvm-rg350-c38ccb18c7e4215ae49673b5c261fe3116461129.tar.bz2 scummvm-rg350-c38ccb18c7e4215ae49673b5c261fe3116461129.zip | |
don't pass a pointer in a middle of a resource buffer with mixer AUTOFREE flag set (untested but probably fixes #1754525)
svn-id: r29618
| -rw-r--r-- | engines/scumm/he/sound_he.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp index da830515e2..0ded0cbeae 100644 --- a/engines/scumm/he/sound_he.cpp +++ b/engines/scumm/he/sound_he.cpp @@ -659,10 +659,12 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) size = READ_BE_UINT32(ptr + 4) - 8; flags = Audio::Mixer::FLAG_AUTOFREE; + byte *sound = (byte *)malloc(size); + memcpy(sound, ptr + 8, size); _mixer->stopID(_currentMusic); _currentMusic = soundID; - _mixer->playRaw(Audio::Mixer::kMusicSoundType, NULL, ptr + 8, size, rate, flags, soundID); + _mixer->playRaw(Audio::Mixer::kMusicSoundType, NULL, sound, size, rate, flags, soundID); } else if (READ_BE_UINT32(ptr) == MKID_BE('MIDI')) { if (_vm->_imuse) { |
