aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2007-02-26 11:16:31 +0000
committerMax Horn2007-02-26 11:16:31 +0000
commita2a46c55d2c03e12d17eadf33f29dd04430ddcb1 (patch)
tree642f1d879f642152af7c274dcc71e6bfa723a414
parent08fc65bef91af6547a8f5bf40258b48034ca72f7 (diff)
downloadscummvm-rg350-a2a46c55d2c03e12d17eadf33f29dd04430ddcb1.tar.gz
scummvm-rg350-a2a46c55d2c03e12d17eadf33f29dd04430ddcb1.tar.bz2
scummvm-rg350-a2a46c55d2c03e12d17eadf33f29dd04430ddcb1.zip
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
-rw-r--r--engines/kyra/sound_towns.cpp4
1 files changed, 2 insertions, 2 deletions
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);