diff options
author | Torbjörn Andersson | 2009-12-28 15:53:13 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2009-12-28 15:53:13 +0000 |
commit | b6ca638180acbe8b9b45f2a17b97a6c527eaf9e0 (patch) | |
tree | 677b933d496ae6481d3d5a66501ff5d81b74d86c | |
parent | 9f63095688cea735e316b1f6d759d9135eb0bd41 (diff) | |
download | scummvm-rg350-b6ca638180acbe8b9b45f2a17b97a6c527eaf9e0.tar.gz scummvm-rg350-b6ca638180acbe8b9b45f2a17b97a6c527eaf9e0.tar.bz2 scummvm-rg350-b6ca638180acbe8b9b45f2a17b97a6c527eaf9e0.zip |
Create the stream dynamically in playSoundData(), to avoid a crash (spotted by
salty-horse) when makeWAVStream() deletes it.
svn-id: r46676
-rw-r--r-- | engines/agos/sound.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp index b93dce62a2..ac965ac65f 100644 --- a/engines/agos/sound.cpp +++ b/engines/agos/sound.cpp @@ -782,8 +782,8 @@ void Sound::playVoiceData(byte *soundData, uint sound) { void Sound::playSoundData(Audio::SoundHandle *handle, byte *soundData, uint sound, int pan, int vol, bool loop) { int size = READ_LE_UINT32(soundData + 4); - Common::MemoryReadStream stream(soundData, size); - Audio::AudioStream *sndStream = Audio::makeWAVStream(&stream, true, loop); + Common::MemoryReadStream *stream = new Common::MemoryReadStream(soundData, size); + Audio::AudioStream *sndStream = Audio::makeWAVStream(stream, true, loop); convertVolume(vol); convertPan(pan); |