[Scummvm-git-logs] scummvm master -> c1502271b417b0438f19af58c8f1646a81773baa
AndywinXp
noreply at scummvm.org
Mon Sep 26 13:25:28 UTC 2022
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:
c1502271b4 SCUMM: DiMUSE: Don't crash the app if we try to deallocate a non-existent soundfile
Commit: c1502271b417b0438f19af58c8f1646a81773baa
https://github.com/scummvm/scummvm/commit/c1502271b417b0438f19af58c8f1646a81773baa
Author: AndywinXp (andywinxp at gmail.com)
Date: 2022-09-26T15:25:18+02:00
Commit Message:
SCUMM: DiMUSE: Don't crash the app if we try to deallocate a non-existent soundfile
Previously we had asserts instructions in place for this; they work under the assumption that the user
always has the sound files available. Unfortunately this assumption breaks in at least two cases:
- The user plays the COMI demo (small version, without sound files);
- The user copies the whole COMI game from the CDs/Steam to the device of choice (e.g. tablet),
and doesn't copy the BUN files over (e.g. for storage issues).
We simply remove the assertions and put a check in its place, and if that check fails we just exit
the function and resume normal execution. This fixes #13845.
Changed paths:
engines/scumm/imuse_digi/dimuse_sndmgr.cpp
diff --git a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
index 000f7a2a578..4a87027fe8e 100644
--- a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -202,7 +202,9 @@ ImuseDigiSndMgr::SoundDesc *ImuseDigiSndMgr::openSound(int32 soundId, const char
}
void ImuseDigiSndMgr::closeSound(SoundDesc *soundDesc) {
- assert(checkForProperHandle(soundDesc));
+ // Check if there's an actual sound to close...
+ if (!checkForProperHandle(soundDesc))
+ return;
if (soundDesc->resPtr) {
bool found = false;
@@ -242,7 +244,9 @@ void ImuseDigiSndMgr::scheduleSoundForDeallocation(int soundId) {
}
}
- assert(checkForProperHandle(soundDesc));
+ // Check if there's an actual sound to deallocate...
+ if (!checkForProperHandle(soundDesc))
+ return;
soundDesc->scheduledForDealloc = true;
}
More information about the Scummvm-git-logs
mailing list