mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 13:50:13 +00:00
Create the stream dynamically in playSoundData(), to avoid a crash (spotted by
salty-horse) when makeWAVStream() deletes it. svn-id: r46676
This commit is contained in:
parent
9f63095688
commit
b6ca638180
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user