From a2a46c55d2c03e12d17eadf33f29dd04430ddcb1 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 26 Feb 2007 11:16:31 +0000 Subject: Using FLAG_AUTOFREE implies free() being called on the memory buffer you passed to the audio stream code -- hence, use malloc and not new[] to allocate the buffer svn-id: r25877 --- engines/kyra/sound_towns.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 713a33ef52..8413cc2ba9 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -206,10 +206,10 @@ void SoundTowns::playSoundEffect(uint8 track) { uint32 playbackBufferSize = (sfxHeaderID == 1) ? sfxHeaderInBufferSize : sfxHeaderOutBufferSize; stopSoundEffect(); - uint8 *sfxPlaybackBuffer = new uint8[playbackBufferSize]; + uint8 *sfxPlaybackBuffer = (uint8 *)malloc(playbackBufferSize); memset(sfxPlaybackBuffer, 0x80, playbackBufferSize); - uint8 * sfxBody = ((uint8*)sfxHeader) + 0x20; + uint8 *sfxBody = ((uint8 *)sfxHeader) + 0x20; if (!sfxHeaderID) { memcpy(sfxPlaybackBuffer, sfxBody, playbackBufferSize); -- cgit v1.2.3