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

athrxx noreply at scummvm.org
Mon Mar 25 21:49:13 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:
fe030bde70 SCUMM: (IMS) - fix bug in set_volchan()


Commit: fe030bde704943d75fae191da6fa60e5ce402ad7
    https://github.com/scummvm/scummvm/commit/fe030bde704943d75fae191da6fa60e5ce402ad7
Author: athrxx (athrxx at scummvm.org)
Date: 2024-03-25T22:48:51+01:00

Commit Message:
SCUMM: (IMS) - fix bug in set_volchan()

This came up in Coverity. If at all, this will only affect DOTT.
MI2 and INDY4 don't have that opcode yet. Maybe this code
path isn't actually ever reached anywhere.

Changed paths:
    engines/scumm/imuse/imuse.cpp


diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp
index c20cde745d7..6b23bc05f2d 100644
--- a/engines/scumm/imuse/imuse.cpp
+++ b/engines/scumm/imuse/imuse.cpp
@@ -1114,10 +1114,10 @@ int IMuseInternal::set_volchan(int sound, int volchan) {
 		}
 		if (sameid == nullptr)
 			return -1;
-		if (num >= r)
+		if (best != nullptr && num >= r)
 			best->clear();
-		player->_vol_chan = volchan;
-		player->setVolume(player->getVolume());
+		sameid->_vol_chan = volchan;
+		sameid->setVolume(sameid->getVolume());
 		return 0;
 	}
 }




More information about the Scummvm-git-logs mailing list