[Scummvm-git-logs] scummvm master -> 36b18fff17215ecba1d7548264d92918a0ce2102

mduggan noreply at scummvm.org
Sun Oct 27 09:50:50 UTC 2024


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:
36b18fff17 DGDS: Fix some coverity warnings


Commit: 36b18fff17215ecba1d7548264d92918a0ce2102
    https://github.com/scummvm/scummvm/commit/36b18fff17215ecba1d7548264d92918a0ce2102
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-10-27T20:50:06+11:00

Commit Message:
DGDS: Fix some coverity warnings

Changed paths:
    engines/dgds/sound.cpp
    engines/dgds/sound/drivers/midi.cpp
    engines/dgds/sound/music.cpp


diff --git a/engines/dgds/sound.cpp b/engines/dgds/sound.cpp
index a8eed4c9c38..eebbb4b5057 100644
--- a/engines/dgds/sound.cpp
+++ b/engines/dgds/sound.cpp
@@ -543,6 +543,8 @@ void Sound::processPlaySound(uint32 obj, bool playBed, bool restoring, const Sou
 		musicSlot = _music->getSlot(obj);
 	}
 
+	assert(musicSlot);
+
 	musicSlot->loop = (data._flags & FLAG_LOOP) ? 1 : 0;
 
 	// Get song priority from either obj or soundRes
diff --git a/engines/dgds/sound/drivers/midi.cpp b/engines/dgds/sound/drivers/midi.cpp
index 3f41f6e7248..b90e3d7642f 100644
--- a/engines/dgds/sound/drivers/midi.cpp
+++ b/engines/dgds/sound/drivers/midi.cpp
@@ -492,16 +492,7 @@ void MidiPlayer_Midi::sendMt32SysEx(const uint32 addr, Common::SeekableReadStrea
 
 	uint16 delay = sysExNoDelay(_sysExBuf, len + 8);
 	if (!noDelay && delay > 0) {
-		// Use the appropriate delay technique based on the current thread.
-		// On the main thread, use SciEngine::sleep() to keep the UI responsive,
-		// which is important because loading patches can take several seconds.
-		// On a timer thread however, SciEngine::sleep() can't be used because
-		// it polls events and updates the screen, which isn't thread safe. (bug #12947)
-		if (mainThread) {
-			g_system->delayMillis(delay);
-		} else {
-			g_system->delayMillis(delay);
-		}
+		g_system->delayMillis(delay);
 	}
 }
 
diff --git a/engines/dgds/sound/music.cpp b/engines/dgds/sound/music.cpp
index 27f63d33048..b6153a86f2f 100644
--- a/engines/dgds/sound/music.cpp
+++ b/engines/dgds/sound/music.cpp
@@ -41,7 +41,16 @@ SciMusic::SciMusic(bool useDigitalSFX) :
 	_useDigitalSFX(useDigitalSFX),
 	_needsResume(true),
 	_globalPause(0),
-	_pMidiDrv(nullptr) {
+	_pMidiDrv(nullptr),
+	_pMixer(nullptr),
+	_dwTempo(0),
+	_needsRemap(false) ,
+	_musicType(MusicType::MT_NULL),
+	_driverFirstChannel(0),
+	_driverLastChannel(0),
+	_currentlyPlayingSample(nullptr),
+	_timeCounter(0)
+{
 
 	// Reserve some space in the playlist, to avoid expensive insertion
 	// operations




More information about the Scummvm-git-logs mailing list