diff options
author | Max Horn | 2003-12-24 17:47:43 +0000 |
---|---|---|
committer | Max Horn | 2003-12-24 17:47:43 +0000 |
commit | 8c4b9bd8d683e862ae8e35d0c53d99b261961ad0 (patch) | |
tree | 4b0920a47447f9ebccd6dd829dd02638b12c4667 | |
parent | 859a9c01290dc6022f99c7fd99ff91d62a3153dc (diff) | |
download | scummvm-rg350-8c4b9bd8d683e862ae8e35d0c53d99b261961ad0.tar.gz scummvm-rg350-8c4b9bd8d683e862ae8e35d0c53d99b261961ad0.tar.bz2 scummvm-rg350-8c4b9bd8d683e862ae8e35d0c53d99b261961ad0.zip |
fix memory leak
svn-id: r11894
-rw-r--r-- | scumm/imuse_digi.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/scumm/imuse_digi.cpp b/scumm/imuse_digi.cpp index 6ec5293762..a1dbcc51b2 100644 --- a/scumm/imuse_digi.cpp +++ b/scumm/imuse_digi.cpp @@ -796,18 +796,15 @@ void IMuseDigital::mixerCallback() { mixer_size &= ~1; // Size *must* be even, after all this is stereo data - byte *buf = (byte *)malloc(mixer_size); - memcpy(buf, _channel[l].data + _channel[l].offset, mixer_size); - _channel[l].offset += mixer_size; - if (_scumm->_mixer->isReady()) { if (!_channel[l].handle.isActive()) _scumm->_mixer->newStream(&_channel[l].handle, _channel[l].freq, _channel[l].mixerFlags, 100000); _scumm->_mixer->setChannelVolume(_channel[l].handle, _channel[l].vol / 1000); _scumm->_mixer->setChannelPan(_channel[l].handle, _channel[l].pan); - _scumm->_mixer->appendStream(_channel[l].handle, buf, mixer_size); + _scumm->_mixer->appendStream(_channel[l].handle, _channel[l].data + _channel[l].offset, mixer_size); } + _channel[l].offset += mixer_size; } } } |