[Scummvm-git-logs] scummvm master -> 3cea10074abe5490f60addd8e9c40ac20e3cb3f2

Strangerke noreply at scummvm.org
Tue May 7 07:16:42 UTC 2024


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:
c609da4a11 BAGEL: Fix potential issue in file buffer allocation (CIC 1544891)
3cea10074a BAGEL: Remove unused functions in master_win (Fixing by side effect CID 1544823, 1544864 1544890)


Commit: c609da4a113785b5e182ede34935d822d9b6c599
    https://github.com/scummvm/scummvm/commit/c609da4a113785b5e182ede34935d822d9b6c599
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-07T08:16:31+01:00

Commit Message:
BAGEL: Fix potential issue in file buffer allocation (CIC 1544891)

Changed paths:
    engines/bagel/baglib/master_win.cpp


diff --git a/engines/bagel/baglib/master_win.cpp b/engines/bagel/baglib/master_win.cpp
index 4ecdac409d5..e9f7ae5b750 100644
--- a/engines/bagel/baglib/master_win.cpp
+++ b/engines/bagel/baglib/master_win.cpp
@@ -569,7 +569,7 @@ ErrorCode CBagMasterWin::loadGlobalVars(const CBofString &wldName) {
 
 		MACROREPLACE(wldFileName);
 
-		if (fileExists(wldFileName)) {
+		if (fileExists(wldFileName) && (fileLength(wldFileName) > 0)) {
 			// Force buffer to be big enough so that the entire script
 			// is pre-loaded
 			int length = fileLength(wldFileName);
@@ -585,16 +585,14 @@ ErrorCode CBagMasterWin::loadGlobalVars(const CBofString &wldName) {
 				while (!fpInput.eof()) {
 					fpInput.eatWhite();
 
-					KEYWORDS keyword;
-
 					if (!fpInput.eatWhite()) {
 						break;
 					}
 
+					KEYWORDS keyword;
 					getKeywordFromStream(fpInput, keyword);
 
 					switch (keyword) {
-
 					case VARIABLE: {
 						CBagVar *var = new CBagVar;
 						fpInput.eatWhite();


Commit: 3cea10074abe5490f60addd8e9c40ac20e3cb3f2
    https://github.com/scummvm/scummvm/commit/3cea10074abe5490f60addd8e9c40ac20e3cb3f2
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-07T08:16:31+01:00

Commit Message:
BAGEL: Remove unused functions in master_win (Fixing by side effect CID 1544823, 1544864 1544890)

Changed paths:
    engines/bagel/baglib/master_win.h


diff --git a/engines/bagel/baglib/master_win.h b/engines/bagel/baglib/master_win.h
index 74f0f94bf6e..d9f93251983 100644
--- a/engines/bagel/baglib/master_win.h
+++ b/engines/bagel/baglib/master_win.h
@@ -144,7 +144,6 @@ public:
 
 	ErrorCode loadFile(const CBofString &wldName, const CBofString &startWldName, bool restartFl = false, bool setStartFl = true);
 
-	ErrorCode saveFile(const CBofString &wldName);
 	ErrorCode loadFileFromStream(CBagIfstream &input, const CBofString &wldName);
 	ErrorCode loadGlobalVars(const CBofString &wldName);
 
@@ -200,14 +199,6 @@ public:
 
 	void saveSDevStack();
 
-	void *getDataStart() override {
-		return &_gameWindow;
-	}
-
-	void *getDataEnd() override {
-		return &_variableList + sizeof(CBagVarManager *);
-	}
-
 	// Since we do this from load file and do restore, centralize it in one location.
 	void restoreActiveMessages(CBagStorageDevManager *sdevManager);
 };




More information about the Scummvm-git-logs mailing list