[Scummvm-git-logs] scummvm master -> 95f8e1404f38352980f83c93565257f82c546ec0

sluicebox noreply at scummvm.org
Tue Oct 31 21:23:14 UTC 2023


This automated email contains information about 18 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e810d90a7f DRAGONS: Delete array instead of object. PVS-Studio V611
683e7f0aec SCUMM: HE: Delete array instead of object. PVS-Studio V611
58bb4f81e4 SCUMM: Remove unused dummyArgs. PVS-Studio V597
789ee5f403 SCUMM: Add missing else keyword. PVS-Studio V646
954f990ba1 SCUMM: Remove redundant check from NutRenderer. PVS-Studio V560
6bffed45b3 SCI: Remove redundant checks. PVS-Studio V547
4a4b3801f1 SCI: Use correct array type in cmdAudioDump. PVS-Studio V1032
6d6f698f9b HPL1: Fix indexes in OpenALSoundEnvironment. PVS-Studio V557
558805d547 HPL1: Fix log statement. PVS-Studio V510
1bfd160c92 HPL1: Fix nullptr deref in error message. PVS-Studio V522
5818c4be33 HPL1: Fix use after free in error message. PVS-Studio V774
b794a308fe HOPKINS: Remove free(nullptr). PVS-Studio V575
1bb58d7937 DIRECTOR: Remove freeing nullptr. PVS-Studio V575
d6acb1a143 BBVS: Remove redundant assignment. PVS-Studio V517
1e546bf51d BLADERUNNER: Remove extra event arrays. PVS Studio V575
a7d90a8ff7 GOB: Add missing comma to wobble table. PVS-Studio V737
3164b8c5f5 CHEWY: Fix typo in character literal. PVS-Studio V1039
95f8e1404f COMMON: Use logical Or in SubReadStream::eos. PVS-Studio V792


Commit: e810d90a7fbe7a31de39bd5b66e37d6d9b82c115
    https://github.com/scummvm/scummvm/commit/e810d90a7fbe7a31de39bd5b66e37d6d9b82c115
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:25-07:00

Commit Message:
DRAGONS: Delete array instead of object. PVS-Studio V611

Changed paths:
    engines/dragons/vabsound.cpp


diff --git a/engines/dragons/vabsound.cpp b/engines/dragons/vabsound.cpp
index 7ba49da4544..369b5a019e6 100644
--- a/engines/dragons/vabsound.cpp
+++ b/engines/dragons/vabsound.cpp
@@ -97,7 +97,7 @@ void VabSound::loadHeader(Common::SeekableReadStream *vhData) {
 
 VabSound::~VabSound() {
 	delete _toneAttrs;
-	delete _vbData;
+	delete[] _vbData;
 }
 
 Audio::AudioStream *VabSound::getAudioStream(uint16 program, uint16 key) {


Commit: 683e7f0aec271a52daa66658b998aafb3d9e70b9
    https://github.com/scummvm/scummvm/commit/683e7f0aec271a52daa66658b998aafb3d9e70b9
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:25-07:00

Commit Message:
SCUMM: HE: Delete array instead of object. PVS-Studio V611

Changed paths:
    engines/scumm/he/moonbase/ai_main.cpp


diff --git a/engines/scumm/he/moonbase/ai_main.cpp b/engines/scumm/he/moonbase/ai_main.cpp
index b864fbfb216..48a63c6c7c5 100644
--- a/engines/scumm/he/moonbase/ai_main.cpp
+++ b/engines/scumm/he/moonbase/ai_main.cpp
@@ -341,7 +341,7 @@ int AI::masterControlProgram(const int paramCount, const int32 *params) {
 			_behavior = OFFENSE_MODE;
 
 		if (launchAction != NULL) {
-			delete launchAction;
+			delete[] launchAction;
 			launchAction = NULL;
 		}
 
@@ -737,7 +737,7 @@ int AI::masterControlProgram(const int paramCount, const int32 *params) {
 
 		if (tempLaunchAction != NULL) {
 			if (launchAction != NULL) {
-				delete launchAction;
+				delete[] launchAction;
 				launchAction = NULL;
 			}
 


Commit: 58bb4f81e4d7512f9ba95af42a40424e3d0f34cb
    https://github.com/scummvm/scummvm/commit/58bb4f81e4d7512f9ba95af42a40424e3d0f34cb
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:25-07:00

Commit Message:
SCUMM: Remove unused dummyArgs. PVS-Studio V597

The intent was to pass zero arguments using dummyArgs, but that would
have caused out of bounds reads because runScript expects an array of
size NUM_SCRIPT_LOCAL (25). Passing `args` worked because it was
already zeroed out, but runScript also accepts null for this purpose.

See: 19b45e2a500153ace296a65a7ab3094246d0e134

Changed paths:
    engines/scumm/gfx_gui.cpp


diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
index 9b294344641..ff51788f771 100644
--- a/engines/scumm/gfx_gui.cpp
+++ b/engines/scumm/gfx_gui.cpp
@@ -2297,10 +2297,7 @@ void ScummEngine::showMainMenu() {
 	// Run the passcode script without args to fetch the current
 	// value of the passcode, which is then stored in var 63.
 	if (_game.platform == Common::kPlatformSegaCD) {
-		int dummyArgs[16];
-		memset(dummyArgs, 0, sizeof(dummyArgs));
-
-		runScript(61, 0, 0, args);
+		runScript(61, 0, 0, nullptr);
 	}
 
 	// Generate the thumbnail, in case the game is saved


Commit: 789ee5f403db975d00147cdc37cbb75a22c322e0
    https://github.com/scummvm/scummvm/commit/789ee5f403db975d00147cdc37cbb75a22c322e0
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:26-07:00

Commit Message:
SCUMM: Add missing else keyword. PVS-Studio V646

Changed paths:
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 071dca20fb1..dbdc7fe0c6f 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1332,7 +1332,7 @@ void ScummEngine::setupScumm(const Common::String &macResourceFile) {
 	if (_game.platform == Common::kPlatformMacintosh) {
 		if (_game.id == GID_INDY3) {
 			macFontFile = macResourceFile;
-		} if (_game.id == GID_LOOM) {
+		} else if (_game.id == GID_LOOM) {
 			macInstrumentFile = macResourceFile;
 			macFontFile = macResourceFile;
 			_macCursorFile = macResourceFile;


Commit: 954f990ba196dcc2b44a8211a75e4bf6b1884279
    https://github.com/scummvm/scummvm/commit/954f990ba196dcc2b44a8211a75e4bf6b1884279
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:26-07:00

Commit Message:
SCUMM: Remove redundant check from NutRenderer. PVS-Studio V560

This same code appears a few lines earlier.

Changed paths:
    engines/scumm/nut_renderer.cpp


diff --git a/engines/scumm/nut_renderer.cpp b/engines/scumm/nut_renderer.cpp
index 78c59152deb..223fcda612f 100644
--- a/engines/scumm/nut_renderer.cpp
+++ b/engines/scumm/nut_renderer.cpp
@@ -459,9 +459,6 @@ int NutRenderer::draw2byte(byte *buffer, Common::Rect &clipRect, int x, int y, i
 
 	const byte *src = _vm->get2byteCharPtr(chr);
 
-	if (width <= 0 || height <= 0)
-		return 0;
-
 	if (minY) {
 		src += ((minY * _vm->_2byteWidth) >> 3);
 		buffer += (minY * pitch);


Commit: 6bffed45b31cdfb445956d07aa657b162b8206b5
    https://github.com/scummvm/scummvm/commit/6bffed45b31cdfb445956d07aa657b162b8206b5
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:26-07:00

Commit Message:
SCI: Remove redundant checks. PVS-Studio V547

Changed paths:
    engines/sci/engine/seg_manager.cpp
    engines/sci/sci.cpp


diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index 50f7d1bbc3e..1b5456bea25 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -455,14 +455,11 @@ reg_t SegManager::allocateHunkEntry(const char *hunk_type, int size) {
 	offset = table->allocEntry();
 
 	reg_t addr = make_reg(_hunksSegId, offset);
-	Hunk *h = &table->at(offset);
+	Hunk &h = table->at(offset);
 
-	if (!h)
-		return NULL_REG;
-
-	h->mem = malloc(size);
-	h->size = size;
-	h->type = hunk_type;
+	h.mem = malloc(size);
+	h.size = size;
+	h.type = hunk_type;
 
 	return addr;
 }
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 6a2298ccb48..686965d973b 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -795,10 +795,10 @@ void SciEngine::exitGame() {
 // Invoked by debugger when a severe error occurs
 void SciEngine::severeError() {
 	if (_gamestate) {
-		ExecStack *xs = &(_gamestate->_executionStack.back());
-		if (xs) {
-			xs->addr.pc.setOffset(_debugState.old_pc_offset);
-			xs->sp = _debugState.old_sp;
+		if (!_gamestate->_executionStack.empty()) {
+			ExecStack &xs = _gamestate->_executionStack.back();
+			xs.addr.pc.setOffset(_debugState.old_pc_offset);
+			xs.sp = _debugState.old_sp;
 		}
 	}
 


Commit: 4a4b3801f1bee051a4c7d8b25cbf266eb36c3121
    https://github.com/scummvm/scummvm/commit/4a4b3801f1bee051a4c7d8b25cbf266eb36c3121
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:27-07:00

Commit Message:
SCI: Use correct array type in cmdAudioDump. PVS-Studio V1032

Changed paths:
    engines/sci/console.cpp


diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index a68508a14f3..c20731620b0 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -1630,11 +1630,11 @@ bool Console::cmdAudioDump(int argc, const char **argv) {
 				return true;
 			}
 
-			byte buffer[4096];
-			const int samplesToRead = ARRAYSIZE(buffer) / 2;
+			int16 buffer[2048];
+			const int samplesToRead = ARRAYSIZE(buffer);
 			uint bytesWritten = 0;
 			int samplesRead;
-			while ((samplesRead = audioStream->readBuffer((int16 *)buffer, samplesToRead))) {
+			while ((samplesRead = audioStream->readBuffer(buffer, samplesToRead))) {
 				uint bytesToWrite = samplesRead * bytesPerSample;
 				outFile.write(buffer, bytesToWrite);
 				bytesWritten += bytesToWrite;


Commit: 6d6f698f9b69adbd4d12912731108e1a136989e2
    https://github.com/scummvm/scummvm/commit/6d6f698f9b69adbd4d12912731108e1a136989e2
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:27-07:00

Commit Message:
HPL1: Fix indexes in OpenALSoundEnvironment. PVS-Studio V557

Changed paths:
    engines/hpl1/engine/impl/OpenALSoundEnvironment.h


diff --git a/engines/hpl1/engine/impl/OpenALSoundEnvironment.h b/engines/hpl1/engine/impl/OpenALSoundEnvironment.h
index cc223085566..f8a7ff8d980 100644
--- a/engines/hpl1/engine/impl/OpenALSoundEnvironment.h
+++ b/engines/hpl1/engine/impl/OpenALSoundEnvironment.h
@@ -78,14 +78,14 @@ public:
 	inline void SetReflectionsPan(float afReflectionsPan[3]) {
 		mfReflectionsPan[0] = afReflectionsPan[0];
 		mfReflectionsPan[1] = afReflectionsPan[1];
-		mfReflectionsPan[2] = afReflectionsPan[3];
+		mfReflectionsPan[2] = afReflectionsPan[2];
 	}
 	inline void SetLateReverbGain(float afLateReverbGain) { mfLateReverbGain = afLateReverbGain; }
 	inline void SetLateReverbDelay(float afLateReverbDelay) { mfLateReverbDelay = afLateReverbDelay; }
 	inline void SetLateReverbPan(float afLateReverbPan[3]) {
 		mfLateReverbPan[0] = afLateReverbPan[0];
 		mfLateReverbPan[1] = afLateReverbPan[1];
-		mfLateReverbPan[2] = afLateReverbPan[3];
+		mfLateReverbPan[2] = afLateReverbPan[2];
 	}
 	inline void SetEchoTime(float afEchoTime) { mfEchoTime = afEchoTime; }
 	inline void SetEchoDepth(float afEchoDepth) { mfEchoDepth = afEchoDepth; }


Commit: 558805d547241c5f78f867729c0a16412685cd16
    https://github.com/scummvm/scummvm/commit/558805d547241c5f78f867729c0a16412685cd16
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:27-07:00

Commit Message:
HPL1: Fix log statement. PVS-Studio V510

Changed paths:
    engines/hpl1/engine/system/SerializeClass.cpp


diff --git a/engines/hpl1/engine/system/SerializeClass.cpp b/engines/hpl1/engine/system/SerializeClass.cpp
index 9c8fbd346c1..9d2995b07ca 100644
--- a/engines/hpl1/engine/system/SerializeClass.cpp
+++ b/engines/hpl1/engine/system/SerializeClass.cpp
@@ -213,7 +213,7 @@ void cSerializeClass::SaveToElement(iSerializable *apData, const tString &asName
 		cSerializeMemberField *pField = classIt.GetNext();
 
 		if (gbLog)
-			Log(" Field : '%s'\n", pField->msName);
+			Log(" Field : '%s'\n", pField->msName.c_str());
 
 		switch (pField->mMainType) {
 		// VARIABLE /////////////////////////////////


Commit: 1bfd160c92af306b158f26efb0adc95329c3be56
    https://github.com/scummvm/scummvm/commit/1bfd160c92af306b158f26efb0adc95329c3be56
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:28-07:00

Commit Message:
HPL1: Fix nullptr deref in error message. PVS-Studio V522

Changed paths:
    engines/hpl1/penumbra-overture/GameLiquidArea.cpp


diff --git a/engines/hpl1/penumbra-overture/GameLiquidArea.cpp b/engines/hpl1/penumbra-overture/GameLiquidArea.cpp
index 672798e35ac..5c478fe4774 100644
--- a/engines/hpl1/penumbra-overture/GameLiquidArea.cpp
+++ b/engines/hpl1/penumbra-overture/GameLiquidArea.cpp
@@ -124,7 +124,7 @@ void cGameLiquidArea::SetPhysicsMaterial(const tString asName) {
 	mpPhysicsMaterial = pPhysicsWorld->GetMaterialFromName(asName);
 	if (mpPhysicsMaterial == NULL) {
 		Error("Liquid '%s' could not find material '%s'\n", GetName().c_str(),
-			  mpPhysicsMaterial->GetName().c_str());
+			  asName.c_str());
 	}
 }
 


Commit: 5818c4be338e23a079e471d2d92b2f93294c2e8a
    https://github.com/scummvm/scummvm/commit/5818c4be338e23a079e471d2d92b2f93294c2e8a
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:28-07:00

Commit Message:
HPL1: Fix use after free in error message. PVS-Studio V774

Changed paths:
    engines/hpl1/engine/scene/World2D.cpp


diff --git a/engines/hpl1/engine/scene/World2D.cpp b/engines/hpl1/engine/scene/World2D.cpp
index d2d3903e871..30e5af652b4 100644
--- a/engines/hpl1/engine/scene/World2D.cpp
+++ b/engines/hpl1/engine/scene/World2D.cpp
@@ -410,8 +410,8 @@ bool cWorld2D::CreateFromFile(tString asFile) {
 							/*Maybe delete entity if no type found? */
 						}
 					} else {
-						hplDelete(pEntity);
 						Error("Couldn't load data for entity '%s'", pEntity->GetName().c_str());
+						hplDelete(pEntity);
 					}
 				} else {
 					error("No other Render mode for entity exist!!");


Commit: b794a308fedcbd5a17a6ecbebffd6751c86b09a0
    https://github.com/scummvm/scummvm/commit/b794a308fedcbd5a17a6ecbebffd6751c86b09a0
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:28-07:00

Commit Message:
HOPKINS: Remove free(nullptr). PVS-Studio V575

This was a result of a find/replace.

See: e79a51c20894a74ac6ed8914daccfeedbfb28849

Changed paths:
    engines/hopkins/globals.cpp


diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp
index 718bc9d66ab..2f027d8f327 100644
--- a/engines/hopkins/globals.cpp
+++ b/engines/hopkins/globals.cpp
@@ -127,7 +127,6 @@ Globals::~Globals() {
 	freeMemory((byte *)_saveData);
 	freeMemory(_answerBuffer);
 	freeMemory(_characterSpriteBuf);
-	free(nullptr);
 }
 
 void Globals::setConfig() {


Commit: 1bb58d7937e7167449288787cb6b07cce3fabfa1
    https://github.com/scummvm/scummvm/commit/1bb58d7937e7167449288787cb6b07cce3fabfa1
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:29-07:00

Commit Message:
DIRECTOR: Remove freeing nullptr. PVS-Studio V575

This was left over from a refactor.

See: ecd6f218dfce2c28b6e459bece7922d6c9a3e9f4

Changed paths:
    engines/director/archive.cpp


diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index 142dcfa09ed..0d63c825ccb 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -263,7 +263,6 @@ void Archive::dumpChunk(Resource &res, Common::DumpFile &out) {
 	uint32 len = resStream->size();
 
 	if (dataSize < len) {
-		free(data);
 		data = (byte *)malloc(resStream->size());
 		dataSize = resStream->size();
 	}


Commit: d6acb1a143b776eeae8ee712802a65d6f50430c7
    https://github.com/scummvm/scummvm/commit/d6acb1a143b776eeae8ee712802a65d6f50430c7
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:29-07:00

Commit Message:
BBVS: Remove redundant assignment. PVS-Studio V517

Changed paths:
    engines/bbvs/minigames/bbairguitar.cpp


diff --git a/engines/bbvs/minigames/bbairguitar.cpp b/engines/bbvs/minigames/bbairguitar.cpp
index 66f032bbfc3..ead1fb876be 100644
--- a/engines/bbvs/minigames/bbairguitar.cpp
+++ b/engines/bbvs/minigames/bbairguitar.cpp
@@ -299,7 +299,6 @@ void MinigameBbAirGuitar::initObjects1() {
 	for (int i = 0; i < 60; ++i)
 		_objects[i].kind = 0;
 
-	_objects[0].kind = 0;
 	_objects[0].kind = 1;
 	_objects[0].anim = getAnimation(0);
 	_objects[0].ticks = getAnimation(0)->frameTicks[0];


Commit: 1e546bf51dd9f8e60d75a523c68c068b6f0517a4
    https://github.com/scummvm/scummvm/commit/1e546bf51dd9f8e60d75a523c68c068b6f0517a4
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:29-07:00

Commit Message:
BLADERUNNER: Remove extra event arrays. PVS Studio V575

The intent was to create a Common::Array with a maximum capacity of 20.
Instead, _activeCustomEvents was a C array of 20 Common::Arrays.
The -> operator accesses the first element of a C array, so the first
Common::Array was always used.

Changed paths:
    engines/bladerunner/bladerunner.cpp
    engines/bladerunner/bladerunner.h


diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 4234e98a691..8fece8e1ec9 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -247,7 +247,7 @@ BladeRunnerEngine::BladeRunnerEngine(OSystem *syst, const ADGameDescription *des
 	_keyRepeatTimeLast = 0;
 	_keyRepeatTimeDelay = 0;
 
-	_activeCustomEvents->clear();
+	_activeCustomEvents.clear();
 	_customEventRepeatTimeLast = 0;
 	_customEventRepeatTimeDelay = 0;
 
@@ -1552,12 +1552,12 @@ void BladeRunnerEngine::handleEvents() {
 					// fall through
 				case kMpDeleteSelectedSvdGame:
 					if (isAllowedRepeatedCustomEvent(event)
-					    && _activeCustomEvents->size() < kMaxCustomConcurrentRepeatableEvents) {
-						if (_activeCustomEvents->empty()) {
+					    && _activeCustomEvents.size() < kMaxCustomConcurrentRepeatableEvents) {
+						if (_activeCustomEvents.empty()) {
 							_customEventRepeatTimeLast = _time->currentSystem();
 							_customEventRepeatTimeDelay = kKeyRepeatInitialDelay;
 						}
-						_activeCustomEvents->push_back(event);
+						_activeCustomEvents.push_back(event);
 					}
 					handleCustomEventStart(event);
 					break;
@@ -1612,12 +1612,12 @@ void BladeRunnerEngine::handleEvents() {
 	// Some of those may lead to their own internal gameTick() loops (which will call handleEvents()).
 	// Thus, we need to get a new timeNow value here to ensure we're not comparing with a stale version.
 	uint32 timeNow = _time->currentSystem();
-	if (!_activeCustomEvents->empty()
+	if (!_activeCustomEvents.empty()
 	    && (timeNow - _customEventRepeatTimeLast >= _customEventRepeatTimeDelay)) {
 		_customEventRepeatTimeLast = timeNow;
 		_customEventRepeatTimeDelay = kKeyRepeatSustainDelay;
-		uint16 aceSize = _activeCustomEvents->size();
-		for (ActiveCustomEventsArray::iterator it = _activeCustomEvents->begin(); it != _activeCustomEvents->end(); it++) {
+		uint16 aceSize = _activeCustomEvents.size();
+		for (ActiveCustomEventsArray::iterator it = _activeCustomEvents.begin(); it != _activeCustomEvents.end(); it++) {
 			// kbdRepeat field will be unused here since we emulate the kbd repeat behavior anyway,
 			// but maybe it's good to set it for consistency
 			it->kbdRepeat = true;
@@ -1630,7 +1630,7 @@ void BladeRunnerEngine::handleEvents() {
 			// TODO This is probably an indication that this could be reworked
 			//      as something cleaner and safer.
 			//      Or event repetition could be handled by the keymapper code (outside the engine code)
-			if (aceSize != _activeCustomEvents->size()) {
+			if (aceSize != _activeCustomEvents.size()) {
 				break;
 			}
 		}
@@ -1756,18 +1756,18 @@ void BladeRunnerEngine::cleanupPendingRepeatingEvents(const Common::String &keym
 
 	if (getEventManager()->getKeymapper() != nullptr
 	    && getEventManager()->getKeymapper()->getKeymap(keymapperId) != nullptr
-		&& !_activeCustomEvents->empty()) {
+		&& !_activeCustomEvents.empty()) {
 
 		Common::Keymap::ActionArray actionsInKm = getEventManager()->getKeymapper()->getKeymap(keymapperId)->getActions();
 		for (Common::Keymap::ActionArray::iterator kmIt = actionsInKm.begin(); kmIt != actionsInKm.end(); ++kmIt) {
-			for (ActiveCustomEventsArray::iterator actIt = _activeCustomEvents->begin(); actIt != _activeCustomEvents->end(); ++actIt) {
+			for (ActiveCustomEventsArray::iterator actIt = _activeCustomEvents.begin(); actIt != _activeCustomEvents.end(); ++actIt) {
 				if ((actIt->type != Common::EVENT_INVALID) && (actIt->customType == (*kmIt)->event.customType)) {
-					_activeCustomEvents->erase(actIt);
+					_activeCustomEvents.erase(actIt);
 					// When erasing an element from an array, erase(iterator pos)
 					// will return an iterator pointing to the next element in the array.
 					// Thus, we should check if we reached the end() here, to avoid moving
 					// the iterator in the next loop repetition to an invalid memory location.
-					if (actIt == _activeCustomEvents->end()) {
+					if (actIt == _activeCustomEvents.end()) {
 						break;
 					}
 				}
@@ -1777,10 +1777,10 @@ void BladeRunnerEngine::cleanupPendingRepeatingEvents(const Common::String &keym
 }
 
 void BladeRunnerEngine::handleCustomEventStop(Common::Event &event) {
-	if (!_activeCustomEvents->empty()) {
-		for (ActiveCustomEventsArray::iterator it = _activeCustomEvents->begin(); it != _activeCustomEvents->end(); it++) {
+	if (!_activeCustomEvents.empty()) {
+		for (ActiveCustomEventsArray::iterator it = _activeCustomEvents.begin(); it != _activeCustomEvents.end(); it++) {
 			if ((it->type != Common::EVENT_INVALID) && (it->customType == event.customType)) {
-				_activeCustomEvents->erase(it);
+				_activeCustomEvents.erase(it);
 				break;
 			}
 		}
diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h
index e44445567f1..cd217d6c7ec 100644
--- a/engines/bladerunner/bladerunner.h
+++ b/engines/bladerunner/bladerunner.h
@@ -296,7 +296,7 @@ public:
 	// However, we should probably restrict the active events
 	// (that can be repeated while holding the mapped keys down)
 	// to a maximum of kMaxCustomConcurrentRepeatableEvents
-	ActiveCustomEventsArray _activeCustomEvents[kMaxCustomConcurrentRepeatableEvents];
+	ActiveCustomEventsArray _activeCustomEvents;
 
 	// NOTE We still need keyboard functionality for naming saved games and also for the KIA Easter eggs.
 	//      In KIA keyboard events should be accounted where possible - however some keymaps are still needed


Commit: a7d90a8ff7381b2da9f0e5a6fdd77b92b726845c
    https://github.com/scummvm/scummvm/commit/a7d90a8ff7381b2da9f0e5a6fdd77b92b726845c
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:30-07:00

Commit Message:
GOB: Add missing comma to wobble table. PVS-Studio V737

Changed paths:
    engines/gob/draw.cpp


diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp
index be4d0a5c988..68b310d642c 100644
--- a/engines/gob/draw.cpp
+++ b/engines/gob/draw.cpp
@@ -647,7 +647,7 @@ const int16 Draw::_wobbleTable[360] = {
 	 0x259E,  0x24B5,  0x23C9,  0x22DB,  0x21EA,  0x20F6,  0x1FFF,  0x1F07,  0x1E0B,
 	 0x1D0E,  0x1C0E,  0x1B0C,  0x1A07,  0x1901,  0x17F9,  0x16EF,  0x15E3,  0x14D6,
 	 0x13C6,  0x12B6,  0x11A4,  0x1090,  0x0F7B,  0x0E65,  0x0D4E,  0x0C36,  0x0B1D,
-	 0x0A03,  0x08E8,  0x07CC,  0x06B0,  0x0593,  0x0476,  0x0359,  0x023B,  0x011D
+	 0x0A03,  0x08E8,  0x07CC,  0x06B0,  0x0593,  0x0476,  0x0359,  0x023B,  0x011D,
 	-0x0000, -0x011D, -0x023B, -0x0359, -0x0476, -0x0593, -0x06B0, -0x07CC, -0x08E8,
 	-0x0A03, -0x0B1D, -0x0C36, -0x0D4E, -0x0E65, -0x0F7B, -0x1090, -0x11A4, -0x12B6,
 	-0x13C6, -0x14D6, -0x15E3, -0x16EF, -0x17F9, -0x1901, -0x1A07, -0x1B0C, -0x1C0E,


Commit: 3164b8c5f5c67ddb135bc752bddee10f3168ec28
    https://github.com/scummvm/scummvm/commit/3164b8c5f5c67ddb135bc752bddee10f3168ec28
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:30-07:00

Commit Message:
CHEWY: Fix typo in character literal. PVS-Studio V1039

Changed paths:
    engines/chewy/audio/module_tmf.cpp


diff --git a/engines/chewy/audio/module_tmf.cpp b/engines/chewy/audio/module_tmf.cpp
index 7704087e4f4..104af5b1558 100644
--- a/engines/chewy/audio/module_tmf.cpp
+++ b/engines/chewy/audio/module_tmf.cpp
@@ -28,7 +28,7 @@ const uint8 Chewy::Module_TMF::TMF_MOD_SONG_NAME[] = {
 	'S', 'C', 'U', 'M', 'M',
 	'V', 'M', ' ', 'M', 'O',
 	'D', 'U', 'L', 'E', '\0',
-	'\0', '\0', '\0', '\0', '\0', '\0;'
+	'\0', '\0', '\0', '\0', '\0', '\0'
 };
 const uint8 Chewy::Module_TMF::TMF_MOD_INSTRUMENT_NAME[] = {
 	'S', 'C', 'U', 'M', 'M',


Commit: 95f8e1404f38352980f83c93565257f82c546ec0
    https://github.com/scummvm/scummvm/commit/95f8e1404f38352980f83c93565257f82c546ec0
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-10-31T14:20:30-07:00

Commit Message:
COMMON: Use logical Or in SubReadStream::eos. PVS-Studio V792

Changed paths:
    common/substream.h


diff --git a/common/substream.h b/common/substream.h
index 70cf88889d4..ef5b0e63421 100644
--- a/common/substream.h
+++ b/common/substream.h
@@ -61,7 +61,7 @@ public:
 		assert(parentStream);
 	}
 
-	virtual bool eos() const { return _eos | _parentStream->eos(); }
+	virtual bool eos() const { return _eos || _parentStream->eos(); }
 	virtual bool err() const { return _parentStream->err(); }
 	virtual void clearErr() { _eos = false; _parentStream->clearErr(); }
 	virtual uint32 read(void *dataPtr, uint32 dataSize);




More information about the Scummvm-git-logs mailing list