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

sev- noreply at scummvm.org
Tue Nov 29 00:47:00 UTC 2022


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

Summary:
e139c4ea68 FREESCAPE: Fix potentially uninitialized variable
ca37dccb5a SCUMM: Fix incorrect usage of Common::String internals


Commit: e139c4ea6892bf28e2b27a11dda694114c999302
    https://github.com/scummvm/scummvm/commit/e139c4ea6892bf28e2b27a11dda694114c999302
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-11-29T01:45:15+01:00

Commit Message:
FREESCAPE: Fix potentially uninitialized variable

Changed paths:
    engines/freescape/loaders/8bitBinaryLoader.cpp


diff --git a/engines/freescape/loaders/8bitBinaryLoader.cpp b/engines/freescape/loaders/8bitBinaryLoader.cpp
index 3a7d2a09a2a..ab5b1f0ef4c 100644
--- a/engines/freescape/loaders/8bitBinaryLoader.cpp
+++ b/engines/freescape/loaders/8bitBinaryLoader.cpp
@@ -591,7 +591,7 @@ void FreescapeEngine::loadBundledImages() {
 void FreescapeEngine::loadFonts(Common::SeekableReadStream *file, int offset) {
 	file->seek(offset);
 	int charNumber = 60;
-	byte *font;
+	byte *font = nullptr;
 	if (isDOS()) {
 		font = (byte *)malloc(6 * charNumber);
 		file->read(font, 6 * charNumber);
@@ -605,6 +605,8 @@ void FreescapeEngine::loadFonts(Common::SeekableReadStream *file, int offset) {
 
 		_font.set_size(fontSize * 8);
 		_font.set_bits((byte *)font);
+	} else {
+		_fontLoaded = false;
 	}
 	_fontLoaded = true;
 	free(font);


Commit: ca37dccb5af6309d913aca382682704a03198b35
    https://github.com/scummvm/scummvm/commit/ca37dccb5af6309d913aca382682704a03198b35
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-11-29T01:45:37+01:00

Commit Message:
SCUMM: Fix incorrect usage of Common::String internals

c_str() is constant for a reason, moreover, sizeof(String object)
is always bigger because it contains additional class variables.

Changed paths:
    engines/scumm/script_v4.cpp


diff --git a/engines/scumm/script_v4.cpp b/engines/scumm/script_v4.cpp
index 6cce5e067f9..7c2e827c00e 100644
--- a/engines/scumm/script_v4.cpp
+++ b/engines/scumm/script_v4.cpp
@@ -453,7 +453,7 @@ void ScummEngine_v4::o4_saveLoadGame() {
 				Common::strlcpy(name, ptr, sizeof(name));
 			}
 
-			Common::strlcpy((char *)_saveLoadDescription.c_str(), name, sizeof(_saveLoadDescription));
+			_saveLoadDescription = name;
 			if (saveState(slot, false, dummyName))
 				result = 0;
 			else




More information about the Scummvm-git-logs mailing list