[Scummvm-git-logs] scummvm master -> 94d5c2a861735a9167a8742cb054610e9103846a

mduggan noreply at scummvm.org
Sat Jun 27 23:17:01 UTC 2026


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

Summary:
94d5c2a861 ACCESS: Fix small Coverity issues


Commit: 94d5c2a861735a9167a8742cb054610e9103846a
    https://github.com/scummvm/scummvm/commit/94d5c2a861735a9167a8742cb054610e9103846a
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2026-06-28T09:16:16+10:00

Commit Message:
ACCESS: Fix small Coverity issues

In practice none of these caused issues, but nicer to clean them up.

Changed paths:
    engines/access/access.cpp
    engines/access/files.cpp
    engines/access/files.h
    engines/access/noctropolis/noctropolis_game.cpp
    engines/access/room.cpp


diff --git a/engines/access/access.cpp b/engines/access/access.cpp
index 04c92b2ddcd..577a43e5fbe 100644
--- a/engines/access/access.cpp
+++ b/engines/access/access.cpp
@@ -459,7 +459,7 @@ void AccessEngine::plotList1() {
 
 void AccessEngine::clearPlotImagesIn(int16 x, int16 y, int16 w, int16 h) {
 	const Common::Rect toClear = Common::Rect(Common::Point(x, y), w, h);
-	for (uint idx = 0; idx < _images.size(); idx++) {
+	for (int idx = 0; idx < (int)_images.size(); idx++) {
 		const SpriteFrame *frame = _images[idx]._spritesPtr->getFrame(_images[idx]._frameNumber);
 		Common::Point topLeft = _images[idx]._position;
 		Common::Rect imgRect(topLeft, frame->w, frame->h);
@@ -619,6 +619,9 @@ bool AccessEngine::readSavegameHeader(Common::InSaveFile *in, AccessSavegameHead
 	if (strncmp(saveIdentBuffer, SAVEGAME_STR, SAVEGAME_STR_SIZE))
 		return false;
 
+	// This legacy header format doesn't include _totalPlayTime
+	header._totalPlayTime = 0;
+
 	header._version = in->readByte();
 	if (header._version > ACCESS_SAVEGAME_VERSION)
 		return false;
diff --git a/engines/access/files.cpp b/engines/access/files.cpp
index 7280d95b917..b31aa2db5fe 100644
--- a/engines/access/files.cpp
+++ b/engines/access/files.cpp
@@ -68,7 +68,7 @@ Resource::Resource(byte *p, int size) {
 	_stream = new Common::MemoryReadStream(p, size);
 }
 
-byte *Resource::data() {
+const byte *Resource::data() {
 	if (_data == nullptr) {
 		_data = new byte[_size];
 		int pos = _stream->pos();
diff --git a/engines/access/files.h b/engines/access/files.h
index ea83ae92e31..e54c8cf32d9 100644
--- a/engines/access/files.h
+++ b/engines/access/files.h
@@ -64,7 +64,7 @@ public:
 	Resource();
 	Resource(byte *data, int size);
 	~Resource();
-	byte *data();
+	const byte *data();
 
 	const char *getFileName() const;
 };
diff --git a/engines/access/noctropolis/noctropolis_game.cpp b/engines/access/noctropolis/noctropolis_game.cpp
index 51357662c6a..0d990c901c2 100644
--- a/engines/access/noctropolis/noctropolis_game.cpp
+++ b/engines/access/noctropolis/noctropolis_game.cpp
@@ -258,16 +258,17 @@ void NoctropolisEngine::doPublisherLogo() {
 			}
 		}
 		delete bestPal;
+		delete scaledPng;
 		_screen->fadeIn();
 
 		_events->_vbCount = 0x7e;
 		while (!shouldQuit() && (_events->_vbCount > 0) && !_events->isKeyActionMousePressed()) {
 			_events->pollEventsAndWait();
 		}
+
 		if (shouldQuit())
 			return;
 		_screen->fadeOut();
-
 	} else {
 		// The original EA release, show their logo.
 		//
@@ -471,7 +472,7 @@ void NoctropolisEngine::doTravel() {
 
 		_player->calcPlayer();
 
-		for (int i = 0; i < 15; i++) {
+		for (int i = 0; i < 14; i++) {
 			if (_travel[i]) {
 				int x = TRAV_ICONS[i * 3 + 0];
 				int y = TRAV_ICONS[i * 3 + 1];
diff --git a/engines/access/room.cpp b/engines/access/room.cpp
index be08fdfd034..15b0a3e8c58 100644
--- a/engines/access/room.cpp
+++ b/engines/access/room.cpp
@@ -352,7 +352,9 @@ void Room::loadRoomData(const byte *roomData) {
 	if (_vm->getGameID() == kGameNoctropolis && _roomFlag & kRoomFlagStiletto) {
 		// Load _vm->_screen->_stilPal
 		Resource *stilPal = _vm->_files->loadFile(0xfd, _palIntensity + 6);
-		memcpy(_vm->_screen->_stilPal, stilPal->data() + 480, 99);
+		const byte *stilPalData = stilPal->data();
+		assert(stilPal->_size >= 480 + 99);
+		memcpy(_vm->_screen->_stilPal, stilPalData + 480, 99);
 		delete stilPal;
 
 		Player *stil = ((Noctropolis::NoctropolisEngine *)_vm)->_stil;




More information about the Scummvm-git-logs mailing list