[Scummvm-git-logs] scummvm master -> 0f1b3e63f698299b8babae28d286e301afc3f6c3
sev-
noreply at scummvm.org
Fri Feb 21 14:46:22 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0f1b3e63f6 DIRECTOR: Fix crash on stopped sounds
Commit: 0f1b3e63f698299b8babae28d286e301afc3f6c3
https://github.com/scummvm/scummvm/commit/0f1b3e63f698299b8babae28d286e301afc3f6c3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-21T15:46:07+01:00
Commit Message:
DIRECTOR: Fix crash on stopped sounds
Changed paths:
engines/director/sound.cpp
diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp
index 89a44a1da23..3464fa2c23c 100644
--- a/engines/director/sound.cpp
+++ b/engines/director/sound.cpp
@@ -509,6 +509,9 @@ void DirectorSound::stopSound(uint8 soundChannel) {
void DirectorSound::stopSound() {
debugC(5, kDebugSound, "DirectorSound::stopSound(): stopping all channels");
for (auto it : _channels) {
+ if (!it._value)
+ continue;
+
if (it._value->loopPtr)
it._value->loopPtr = nullptr;
cancelFade(it._key);
@@ -641,7 +644,7 @@ void DirectorSound::playFPlaySound(const Common::Array<Common::String> &fplayLis
}
void DirectorSound::setChannelVolumeInternal(uint8 soundChannel, uint8 volume) {
- if (volume == _channels[soundChannel]->volume)
+ if (!(_channels[soundChannel]) || volume == _channels[soundChannel]->volume)
return;
cancelFade(soundChannel);
More information about the Scummvm-git-logs
mailing list