[Scummvm-git-logs] scummvm master -> fb3873e9beeca3d6a20079a13fa26ad7eecf21e5

sluicebox noreply at scummvm.org
Wed Nov 29 14:55:00 UTC 2023


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1e84bbae4d BLADERUNNER: Fix memory leak in AudioMixer
fb3873e9be SLUDGE: Fix memory leak in transition


Commit: 1e84bbae4dc7fc4e716a74bc941d9d6add189012
    https://github.com/scummvm/scummvm/commit/1e84bbae4dc7fc4e716a74bc941d9d6add189012
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-11-29T06:54:30-08:00

Commit Message:
BLADERUNNER: Fix memory leak in AudioMixer

Coverity CID 1419822

Changed paths:
    engines/bladerunner/audio_mixer.cpp


diff --git a/engines/bladerunner/audio_mixer.cpp b/engines/bladerunner/audio_mixer.cpp
index 55d1e700a23..024b059b890 100644
--- a/engines/bladerunner/audio_mixer.cpp
+++ b/engines/bladerunner/audio_mixer.cpp
@@ -136,18 +136,17 @@ int AudioMixer::playInChannel(int channel, Audio::Mixer::SoundType type, Audio::
 	_channels[channel].timeStarted = _vm->_time->currentSystem();
 	_channels[channel].trackDurationMs = trackDurationMs;
 
-	Audio::AudioStream *audioStream = stream;
-
-	if (loop) {
-		audioStream = new Audio::LoopingAudioStream(stream, 0, DisposeAfterUse::YES);
-	}
-
 	if (!_vm->_mixer->isReady()) {
 		_channels[channel].sentToMixer = false;
 		return channel;
 	}
 	_channels[channel].sentToMixer = true;
 
+	Audio::AudioStream *audioStream = stream;
+	if (loop) {
+		audioStream = new Audio::LoopingAudioStream(stream, 0, DisposeAfterUse::YES);
+	}
+
 	// Note: 127 (multiplier for pan) is the max (abs) balance value (see common/mixer.cpp)
 	_vm->_mixer->playStream(type,
 	                        &_channels[channel].handle,


Commit: fb3873e9beeca3d6a20079a13fa26ad7eecf21e5
    https://github.com/scummvm/scummvm/commit/fb3873e9beeca3d6a20079a13fa26ad7eecf21e5
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-11-29T06:54:30-08:00

Commit Message:
SLUDGE: Fix memory leak in transition

Coverity CID 1453184

Changed paths:
    engines/sludge/transition.cpp


diff --git a/engines/sludge/transition.cpp b/engines/sludge/transition.cpp
index 0b43149616e..c4a1d6e5298 100644
--- a/engines/sludge/transition.cpp
+++ b/engines/sludge/transition.cpp
@@ -64,6 +64,8 @@ void GraphicsManager::transitionSnapshotBox() {
 	Graphics::Surface *surf = _snapshotSurface.scale(xScale, yScale);
 
 	_renderSurface.copyRectToSurface(surf->getPixels(), surf->pitch, (_winWidth - xScale) / 2, (_winHeight - yScale) / 2, xScale, yScale);
+
+	delete surf;
 }
 
 //----------------------------------------------------




More information about the Scummvm-git-logs mailing list