[Scummvm-git-logs] scummvm master -> 50c2514dcaa33dca26266bd9390ccc69073564a3

npjg noreply at scummvm.org
Sun Jan 12 19:18:15 UTC 2025


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

Summary:
7103903e56 MEDIASTATION: Initialize class fields that were left uninitialized
88c0e6202e MEDIASTATION: Address some memory leaks in Boot.
09dce60db6 MEDIASTATION: Fix copy-paste mistake in detection entry
7b003b6821 MEDIASTATION: Skip the odd asset link sections
50c2514dca MEDIASTATION: Add the Unk1 variable type seen in Dalmatians


Commit: 7103903e564a3f859b0053ef6210f8eb31215476
    https://github.com/scummvm/scummvm/commit/7103903e564a3f859b0053ef6210f8eb31215476
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2025-01-12T14:07:31-05:00

Commit Message:
MEDIASTATION: Initialize class fields that were left uninitialized

This addresses some Coverity defects that were found,
as well as just adding some other initializations for good measure.

Changed paths:
    engines/mediastation/assets/movie.h
    engines/mediastation/boot.h


diff --git a/engines/mediastation/assets/movie.h b/engines/mediastation/assets/movie.h
index b1ab03dc17d..6f6e45267b7 100644
--- a/engines/mediastation/assets/movie.h
+++ b/engines/mediastation/assets/movie.h
@@ -34,28 +34,28 @@ class MovieFrameHeader : public BitmapHeader {
 public:
 	MovieFrameHeader(Chunk &chunk);
 
-	uint _index;
-	uint _keyframeEndInMilliseconds;
+	uint _index = 0;
+	uint _keyframeEndInMilliseconds = 0;
 };
 
 class MovieFrameFooter {
 public:
 	MovieFrameFooter(Chunk &chunk);
 
-	uint _unk1;
-	uint _unk2;
-	uint _startInMilliseconds;
-	uint _endInMilliseconds;
-	uint _left;
-	uint _top;
-	uint _unk3;
-	uint _unk4;
-	uint _zIndex; // TODO: This is still unconfirmed but seems likely.
-	uint _unk6;
-	uint _unk7;
-	uint _unk8;
-	uint _unk9;
-	uint _index;
+	uint _unk1 = 0;
+	uint _unk2 = 0;
+	uint _startInMilliseconds = 0;
+	uint _endInMilliseconds = 0;
+	uint _left = 0;
+	uint _top = 0;
+	uint _unk3 = 0;
+	uint _unk4 = 0;
+	uint _zIndex = 0; // TODO: This is still unconfirmed but seems likely.
+	uint _unk6 = 0;
+	uint _unk7 = 0;
+	uint _unk8 = 0;
+	uint _unk9 = 0;
+	uint _index = 0;
 };
 
 class MovieFrame : public Bitmap {
@@ -76,11 +76,11 @@ public:
 	// that could be confusing.
 	uint32 zCoordinate();
 
-	bool _showing;
+	bool _showing = false;
 
 private:
-	MovieFrameHeader *_bitmapHeader;
-	MovieFrameFooter *_footer;
+	MovieFrameHeader *_bitmapHeader = nullptr;
+	MovieFrameFooter *_footer = nullptr;
 };
 
 enum MovieSectionType {
diff --git a/engines/mediastation/boot.h b/engines/mediastation/boot.h
index c5d3a5da4c3..8337d80e28f 100644
--- a/engines/mediastation/boot.h
+++ b/engines/mediastation/boot.h
@@ -37,15 +37,15 @@ public:
 
 	// The version number of this engine,
 	// in the form 4.0r8 (major . minor r revision).
-	uint32 _majorVersion;
-	uint32 _minorVersion;
-	uint32 _revision;
+	uint32 _majorVersion = 0;
+	uint32 _minorVersion = 0;
+	uint32 _revision = 0;
 
 	// A textual description of this engine.
 	// Example: "Title Compiler T4.0r8 built Feb 13 1998 10:16:52"
 	//           ^^^^^^^^^^^^^^  ^^^^^
 	//           | Engine name   | Version number
-	Common::String *string;
+	Common::String *string = nullptr;
 };
 
 enum ContextDeclarationSectionType {
@@ -63,10 +63,10 @@ public:
 	~ContextDeclaration();
 
 	Common::Array<uint32> _fileReferences;
-	uint32 _fileNumber;
-	Common::String *_contextName;
+	uint32 _fileNumber = 0;
+	Common::String *_contextName = nullptr;
 	// Signal that there are no more declarations to read.
-	bool _isLast;
+	bool _isLast = false;
 
 private:
 	ContextDeclarationSectionType getSectionType(Chunk &chunk);
@@ -80,9 +80,9 @@ enum UnknownDeclarationSectionType {
 
 class UnknownDeclaration {
 public:
-	uint16 _unk;
+	uint16 _unk = 0;
 	// Signal that there are no more declarations to read.
-	bool _isLast;
+	bool _isLast = false;
 
 	UnknownDeclaration(Chunk &chunk);
 
@@ -113,11 +113,11 @@ public:
 	FileDeclaration(Chunk &chunk);
 	~FileDeclaration();
 
-	uint32 _id;
+	uint32 _id = 0;
 	IntendedFileLocation _intendedLocation;
-	Common::String *_name;
+	Common::String *_name = nullptr;
 	// Signal that there are no more declarations to read.
-	bool _isLast;
+	bool _isLast = false;
 
 private:
 	FileDeclarationSectionType getSectionType(Chunk &chunk);
@@ -134,11 +134,11 @@ class SubfileDeclaration {
 public:
 	SubfileDeclaration(Chunk &chunk);
 
-	uint16 _assetId;
-	uint16 _fileId;
-	uint32 _startOffsetInFile;
+	uint16 _assetId = 0;
+	uint16 _fileId = 0;
+	uint32 _startOffsetInFile = 0;
 	// Signal that there are no more context declarations to read.
-	bool _isLast;
+	bool _isLast = false;
 
 private:
 	SubfileDeclarationSectionType getSectionType(Chunk &chunk);
@@ -150,15 +150,15 @@ public:
 	CursorDeclaration(Chunk &chunk);
 	~CursorDeclaration();
 
-	uint16 _id;
-	uint16 _unk;
-	Common::String *_name;
+	uint16 _id = 0;
+	uint16 _unk = 0;
+	Common::String *_name = nullptr;
 };
 
 class EngineResourceDeclaration {
 public:
-	Common::String *_resourceName;
-	int _resourceId;
+	Common::String *_resourceName = nullptr;
+	int _resourceId = 0;
 
 	EngineResourceDeclaration(Common::String *resourceName, int resourceId);
 	~EngineResourceDeclaration();


Commit: 88c0e6202ea667c4469dff9f999cfba60405ed5a
    https://github.com/scummvm/scummvm/commit/88c0e6202ea667c4469dff9f999cfba60405ed5a
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2025-01-12T14:14:12-05:00

Commit Message:
MEDIASTATION: Address some memory leaks in Boot.

Just deleting an "empty" declaration isn't very efficient, but
the BOOT.STM is only read once at the very startup of the game, so
it should be fine for now.

Changed paths:
    engines/mediastation/boot.cpp


diff --git a/engines/mediastation/boot.cpp b/engines/mediastation/boot.cpp
index f2d2eeae5b9..353664722fe 100644
--- a/engines/mediastation/boot.cpp
+++ b/engines/mediastation/boot.cpp
@@ -331,6 +331,9 @@ Boot::Boot(const Common::Path &path) : Datafile(path) {
 				_contextDeclarations.setVal(contextDeclaration->_fileNumber, contextDeclaration);
 				contextDeclaration = new ContextDeclaration(chunk);
 			}
+			// The very last declaration is just an empty flag, so delete it
+			// since it's not put in the map.
+			delete contextDeclaration;
 			break;
 		}
 
@@ -340,6 +343,9 @@ Boot::Boot(const Common::Path &path) : Datafile(path) {
 				_unknownDeclarations.push_back(unknownDeclaration);
 				unknownDeclaration = new UnknownDeclaration(chunk);
 			}
+			// The very last declaration is just an empty flag, so delete it
+			// since it's not put in the map.
+			delete unknownDeclaration;
 			break;
 		}
 
@@ -349,6 +355,9 @@ Boot::Boot(const Common::Path &path) : Datafile(path) {
 				_fileDeclarations.setVal(fileDeclaration->_id, fileDeclaration);
 				fileDeclaration = new FileDeclaration(chunk);
 			}
+			// The very last declaration is just an empty flag, so delete it
+			// since it's not put in the map.
+			delete fileDeclaration;
 			break;
 		}
 
@@ -358,6 +367,9 @@ Boot::Boot(const Common::Path &path) : Datafile(path) {
 				_subfileDeclarations.setVal(subfileDeclaration->_assetId, subfileDeclaration);
 				subfileDeclaration = new SubfileDeclaration(chunk);
 			}
+			// The very last declaration is just an empty flag, so delete it
+			// since it's not put in the map.
+			delete subfileDeclaration;
 			break;
 		}
 
@@ -431,6 +443,9 @@ Boot::~Boot() {
 	delete _gameTitle;
 	_gameTitle = nullptr;
 
+	delete _versionInfo;
+	_versionInfo = nullptr;
+
 	_contextDeclarations.clear();
 	_subfileDeclarations.clear();
 	_cursorDeclarations.clear();


Commit: 09dce60db6b744109aa60d7a5768915425b8384e
    https://github.com/scummvm/scummvm/commit/09dce60db6b744109aa60d7a5768915425b8384e
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2025-01-12T14:14:48-05:00

Commit Message:
MEDIASTATION: Fix copy-paste mistake in detection entry

Changed paths:
    engines/mediastation/detection_tables.h


diff --git a/engines/mediastation/detection_tables.h b/engines/mediastation/detection_tables.h
index 74f7cb69f27..fd8f66ee5f7 100644
--- a/engines/mediastation/detection_tables.h
+++ b/engines/mediastation/detection_tables.h
@@ -202,8 +202,8 @@ const ADGameDescription gameDescriptions[] = {
 		"101dalmatians",
 		nullptr,
 		AD_ENTRY2s(
-			"BOOT.STM", "50f30298bf700f357d98c4390f75cb7a", 10932,
-			"100.CXT", "8110f70f1d01d0f42cac9b1bb6d2de12", 4967390
+			"BOOT.STM", "ee6725a718cbce640d02acec2b84825f", 47970,
+			"100.CXT", "2df853283a3fd2d079b06bc27b50527f", 6784502
 		),	
 		Common::EN_USA,
 		Common::kPlatformWindows,


Commit: 7b003b682143d3e52da7c8b1d48dc4f455149625
    https://github.com/scummvm/scummvm/commit/7b003b682143d3e52da7c8b1d48dc4f455149625
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2025-01-12T14:14:49-05:00

Commit Message:
MEDIASTATION: Skip the odd asset link sections

This allows starting Dalmatians to get a little farther :)

Changed paths:
    engines/mediastation/context.cpp


diff --git a/engines/mediastation/context.cpp b/engines/mediastation/context.cpp
index 9fe96471398..a9936995ddd 100644
--- a/engines/mediastation/context.cpp
+++ b/engines/mediastation/context.cpp
@@ -193,6 +193,7 @@ bool Context::readHeaderSection(Subfile &subfile, Chunk &chunk) {
 
 	case kContextAssetLinkSection: {
 		warning("Context::readHeaderSection(): ASSET_LINK not implemented yet");
+		chunk.skip(chunk.bytesRemaining());
 		break;
 	}
 


Commit: 50c2514dcaa33dca26266bd9390ccc69073564a3
    https://github.com/scummvm/scummvm/commit/50c2514dcaa33dca26266bd9390ccc69073564a3
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2025-01-12T14:14:49-05:00

Commit Message:
MEDIASTATION: Add the Unk1 variable type seen in Dalmatians

Still don't know what it is though, so we'll just read it into a datum for now.

Changed paths:
    engines/mediastation/mediascript/variable.cpp


diff --git a/engines/mediastation/mediascript/variable.cpp b/engines/mediastation/mediascript/variable.cpp
index 7b6c6809707..2995427c181 100644
--- a/engines/mediastation/mediascript/variable.cpp
+++ b/engines/mediastation/mediascript/variable.cpp
@@ -78,6 +78,13 @@ Variable::Variable(Chunk &chunk, bool readId) {
 		break;
 	}
 
+	case kVariableTypeUnk1: {
+		_value.i = Datum(chunk).u.i;
+		debugC(7, kDebugLoading, "Variable::Variable(): UNK1: %d", _value.i);
+		warning("Variable::Variable(): Got unknown variable value type 0x%x (0x%llx)", static_cast<uint>(_type), static_cast<long long int>(chunk.pos()));
+		break;
+	}
+
 	default: {
 		error("Variable::Variable(): Got unknown variable value type 0x%x", static_cast<uint>(_type));
 		_value.datum = new Datum(chunk);




More information about the Scummvm-git-logs mailing list