[Scummvm-git-logs] scummvm master -> b86a3c932d4a21a338fb2a550a12ac2f66524d41
mduggan
noreply at scummvm.org
Fri Sep 26 11:31:00 UTC 2025
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
82592751b2 ACCESS: Remove redundant checks (PVS-Studio V560)
b86a3c932d ACCESS: Check malloc result (PVS-Studio V522)
Commit: 82592751b2beebea8b48a14b9044237da58910db
https://github.com/scummvm/scummvm/commit/82592751b2beebea8b48a14b9044237da58910db
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2025-09-26T21:28:08+10:00
Commit Message:
ACCESS: Remove redundant checks (PVS-Studio V560)
Changed paths:
engines/access/amazon/amazon_scripts.cpp
engines/access/animation.cpp
engines/access/scripts.cpp
diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp
index 66be4fbb8ff..738c10134e6 100644
--- a/engines/access/amazon/amazon_scripts.cpp
+++ b/engines/access/amazon/amazon_scripts.cpp
@@ -459,7 +459,7 @@ void AmazonScripts::cmdHelp_v2() {
break;
} else {
// More button selected
- if ((_game->_moreHelp == 0) || (choice != 0))
+ if (_game->_moreHelp == 0)
continue;
++_game->_helpLevel;
_game->_useItem = 1;
diff --git a/engines/access/animation.cpp b/engines/access/animation.cpp
index 92e62ddfac6..f7593693cf6 100644
--- a/engines/access/animation.cpp
+++ b/engines/access/animation.cpp
@@ -56,7 +56,7 @@ Animation::Animation(AccessEngine *vm, Common::SeekableReadStream *stream) : Man
// WORKAROUND: In Amazon floppy English, there's an animation associated with
// the librarian that isn't used, and has junk data. Luckily, it's animation
// type is also invalid, so if the _type isn't in range, exit immediately
- if (_type < 0 || _type > 7) {
+ if (_type > 7) {
_scaling = -1;
_frameNumber = -1;
_initialTicks = _countdownTicks = 0;
diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp
index d4c59dc62a8..0af344868c8 100644
--- a/engines/access/scripts.cpp
+++ b/engines/access/scripts.cpp
@@ -633,7 +633,7 @@ void Scripts::cmdSetAbout() {
int idx = _data->readByte();
byte val = _data->readByte();
- if (idx < 0 || idx >= ARRAYSIZE(_vm->_ask))
+ if (idx >= ARRAYSIZE(_vm->_ask))
error("Invalid index %d in cmdSetAbout", idx);
debugC(1, kDebugScripts, "cmdSetAbout(idx=%d, val=%d)", idx, val);
Commit: b86a3c932d4a21a338fb2a550a12ac2f66524d41
https://github.com/scummvm/scummvm/commit/b86a3c932d4a21a338fb2a550a12ac2f66524d41
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2025-09-26T21:28:08+10:00
Commit Message:
ACCESS: Check malloc result (PVS-Studio V522)
Changed paths:
engines/access/debugger.cpp
diff --git a/engines/access/debugger.cpp b/engines/access/debugger.cpp
index 1680717916f..4d1c9c81c23 100644
--- a/engines/access/debugger.cpp
+++ b/engines/access/debugger.cpp
@@ -393,6 +393,8 @@ bool AmazonDebugger::Cmd_StartChapter(int argc, const char **argv) {
// Build up a simple one line script to start the given chapter
byte *chapterScript = (byte *)malloc(5);
+ if (!chapterScript)
+ error("malloc failed");
chapterScript[0] = SCRIPT_START_BYTE;
chapterScript[1] = ROOM_SCRIPT % 256;
chapterScript[2] = ROOM_SCRIPT / 256;
More information about the Scummvm-git-logs
mailing list