[Scummvm-cvs-logs] SF.net SVN: scummvm: [29618] scummvm/trunk/engines/scumm/he/sound_he.cpp
cyx at users.sourceforge.net
cyx at users.sourceforge.net
Fri Nov 23 19:19:32 CET 2007
Revision: 29618
http://scummvm.svn.sourceforge.net/scummvm/?rev=29618&view=rev
Author: cyx
Date: 2007-11-23 10:19:32 -0800 (Fri, 23 Nov 2007)
Log Message:
-----------
don't pass a pointer in a middle of a resource buffer with mixer AUTOFREE flag set (untested but probably fixes #1754525)
Modified Paths:
--------------
scummvm/trunk/engines/scumm/he/sound_he.cpp
Modified: scummvm/trunk/engines/scumm/he/sound_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/sound_he.cpp 2007-11-23 10:51:16 UTC (rev 29617)
+++ scummvm/trunk/engines/scumm/he/sound_he.cpp 2007-11-23 18:19:32 UTC (rev 29618)
@@ -659,10 +659,12 @@
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) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list