[Scummvm-git-logs] scummvm master -> 03de0244edfeb522fff0c9f0d5afec01597a1010

NMIError noreply at scummvm.org
Thu Aug 4 19:50:53 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:
03de0244ed AGOS: Fix DOS PN and FF demo crash


Commit: 03de0244edfeb522fff0c9f0d5afec01597a1010
    https://github.com/scummvm/scummvm/commit/03de0244edfeb522fff0c9f0d5afec01597a1010
Author: Coen Rampen (crampen at gmail.com)
Date: 2022-08-04T21:50:46+02:00

Commit Message:
AGOS: Fix DOS PN and FF demo crash

The engine would try to initialize the MidiPlayer for all DOS games, even the
ones that don't use MIDI (Personal Nightmare and Feeble Files demos). This
caused a problem with the new MIDI code, which does not set up the necessary
objects for these games and crashed on a null pointer.
This is fixed by adding PN and FF as exceptions to the if condition guarding
initialization of the MidiPlayer.

Changed paths:
    engines/agos/agos.cpp
    engines/agos/midi.cpp


diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 8d4a1f3aa54..952bb56475e 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -612,9 +612,10 @@ Common::Error AGOSEngine::init() {
 	_midi = new MidiPlayer(this);
 
 	if ((getGameType() == GType_SIMON2 && getPlatform() == Common::kPlatformWindows) ||
-		(getGameType() == GType_SIMON1 && getPlatform() == Common::kPlatformWindows) ||
-		((getFeatures() & GF_TALKIE) && getPlatform() == Common::kPlatformAcorn) ||
-		(getPlatform() == Common::kPlatformDOS || getPlatform() == Common::kPlatformPC98)) {
+			(getGameType() == GType_SIMON1 && getPlatform() == Common::kPlatformWindows) ||
+			((getFeatures() & GF_TALKIE) && getPlatform() == Common::kPlatformAcorn) ||
+			(getPlatform() == Common::kPlatformDOS && getGameType() != GType_PN && getGameType() != GType_FF) ||
+			getPlatform() == Common::kPlatformPC98) {
 
 		int ret = _midi->open();
 		if (ret)
diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp
index ab35a26a6db..7f877139718 100644
--- a/engines/agos/midi.cpp
+++ b/engines/agos/midi.cpp
@@ -533,7 +533,7 @@ bool MidiPlayer::isPlaying(bool checkQueued) {
 void MidiPlayer::stop(bool sfx) {
 	Common::StackLock lock(_mutex);
 
-if (!sfx) {
+	if (!sfx) {
 		// Clear the queued track to prevent it from starting when the current
 		// track is stopped.
 		_queuedTrack = 255;




More information about the Scummvm-git-logs mailing list