From 37e204e3a54067118d929991b21ea72abc2d97a0 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Fri, 3 Feb 2006 20:19:01 +0000 Subject: A recent change to loadWAVFromStream() caused the AUTOFREE flag to be set, which in turn causes Broken Sword 2 to crash. And that change made it into 0.8.1, too. Augh! Kudos to wjp for tracking down the bug while I was still waiting for ScummVM to finish compiling. svn-id: r20358 --- sword2/sound.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sword2') diff --git a/sword2/sound.cpp b/sword2/sound.cpp index a84d7324e1..6ee3ef87b9 100644 --- a/sword2/sound.cpp +++ b/sword2/sound.cpp @@ -268,6 +268,13 @@ int32 Sound::playFx(Audio::SoundHandle *handle, byte *data, uint32 len, uint8 vo return RDERR_INVALIDWAV; } + // The resource manager must have complete control over when resources + // are freed, or reference counting will break horribly. Besides, the + // data pointer is not valid for passing to free(). Why the hell is the + // AUTOFREE flag set by default anyway? + + flags &= ~Audio::Mixer::FLAG_AUTOFREE; + if (isReverseStereo()) flags |= Audio::Mixer::FLAG_REVERSE_STEREO; -- cgit v1.2.3