[Scummvm-git-logs] scummvm master -> 4c735979a699891551ff9e60835d3406b5fc62df

sev- sev at scummvm.org
Mon May 4 10:43:55 UTC 2020


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

Summary:
67947621a3 CRYOMNI3D: Properly process corrupted saves
7c446460bc DRAGONS: Fix potential buffer overrun
131e54b3bb DRAGONS: Fix warnings
c4b42a2800 DRAGONS: Avoid global constuctors
fdc9cbb6a3 DRAGONS: Fix another potential buffer overrun
2a23de7f4f DRAGONS: Plug memory leak
af531d6fc7 DRAGONS: Fix more memory leaks
4c735979a6 DRAGONS: Initialize struct members on creation


Commit: 67947621a36e872406d1adabe46a98dd0e8a9754
    https://github.com/scummvm/scummvm/commit/67947621a36e872406d1adabe46a98dd0e8a9754
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T12:07:39+02:00

Commit Message:
CRYOMNI3D: Properly process corrupted saves

Changed paths:
    engines/cryomni3d/versailles/saveload.cpp


diff --git a/engines/cryomni3d/versailles/saveload.cpp b/engines/cryomni3d/versailles/saveload.cpp
index 1af28bee60..e28db7bc87 100644
--- a/engines/cryomni3d/versailles/saveload.cpp
+++ b/engines/cryomni3d/versailles/saveload.cpp
@@ -104,7 +104,10 @@ void CryOmni3DEngine_Versailles::getSavesList(bool visit, Common::StringArray &s
 			Common::InSaveFile *in = _saveFileMan->openForLoading(*file);
 			if (in) {
 				if (in->read(saveName, kSaveDescriptionLen) != kSaveDescriptionLen) {
+					warning("getSavesList(): Corrupted save %s", saveName);
 					delete in;
+
+					continue;
 				}
 
 				Common::String saveNameStr = saveName;


Commit: 7c446460bc99b00b7ac2db74b72d55b709b351f3
    https://github.com/scummvm/scummvm/commit/7c446460bc99b00b7ac2db74b72d55b709b351f3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T12:16:13+02:00

Commit Message:
DRAGONS: Fix potential buffer overrun

Changed paths:
    engines/dragons/talk.cpp


diff --git a/engines/dragons/talk.cpp b/engines/dragons/talk.cpp
index 752ee2df92..1c350e8785 100644
--- a/engines/dragons/talk.cpp
+++ b/engines/dragons/talk.cpp
@@ -80,7 +80,7 @@ void Talk::printWideText(byte *text) {
 		}
 		text += 2;
 	}
-	buf[i] = 0;
+	buf[MAX(i, 1999)] = 0;
 	debug("TEXT: %s", buf);
 }
 


Commit: 131e54b3bb5febef4c7759d6c9d499748777900a
    https://github.com/scummvm/scummvm/commit/131e54b3bb5febef4c7759d6c9d499748777900a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T12:16:36+02:00

Commit Message:
DRAGONS: Fix warnings

Changed paths:
    engines/dragons/dragons.cpp


diff --git a/engines/dragons/dragons.cpp b/engines/dragons/dragons.cpp
index a20d7bb803..b442de352d 100644
--- a/engines/dragons/dragons.cpp
+++ b/engines/dragons/dragons.cpp
@@ -271,8 +271,6 @@ uint16 DragonsEngine::ipt_img_file_related() {
 
 void DragonsEngine::gameLoop() {
 	uint16 prevImgIniId = 0;
-	InventoryState uVar6;
-	InventoryState uVar7;
 	uint16 sequenceId;
 
 	_cursor->_cursorActivationSeqOffset = 0;
@@ -477,9 +475,9 @@ void DragonsEngine::gameLoop() {
 				}
 			}
 			if (_inventory->getState() == InventionBookOpen) {
-				uVar6 = _inventory->getState();
+				InventoryState uVar6 = _inventory->getState();
 				if (checkForInventoryButtonRelease() && isInputEnabled()) {
-					uVar7 = _inventory->_previousState;
+					InventoryState uVar7 = _inventory->_previousState;
 					if (_dragonVAR->getVar(7) == 1) {
 						_inventory->_previousState = uVar7;
 						_inventory->inventoryMissing();
@@ -519,7 +517,7 @@ void DragonsEngine::gameLoop() {
 			_inventory->setPreviousState();
 			continue;
 		}
-		uVar6 = _inventory->getState();
+		InventoryState uVar6 = _inventory->getState();
 		if (checkForActionButtonRelease() && isFlagSet(ENGINE_FLAG_8)) {
 			_flickerIdleCounter = 0;
 			if ((_cursor->_iniUnderCursor & 0x8000) != 0) {


Commit: c4b42a2800f3ccbc253f63983cd3e3e1a0d5220f
    https://github.com/scummvm/scummvm/commit/c4b42a2800f3ccbc253f63983cd3e3e1a0d5220f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T12:16:51+02:00

Commit Message:
DRAGONS: Avoid global constuctors

Changed paths:
    engines/dragons/inventory.cpp


diff --git a/engines/dragons/inventory.cpp b/engines/dragons/inventory.cpp
index 3de95458be..726b163158 100644
--- a/engines/dragons/inventory.cpp
+++ b/engines/dragons/inventory.cpp
@@ -33,11 +33,13 @@
 namespace Dragons {
 
 
-static const Common::Point positionTable[4] = {
-	Common::Point(2, 0),
-	Common::Point(0xce, 0),
-	Common::Point(2, 0x9e),
-	Common::Point(0xce, 0x9e)
+static const struct {
+	int x, y;
+} positionTable[4] = {
+	{   2,   0 },
+	{ 206,   0 },
+	{   2, 158 },
+	{ 206, 158 }
 };
 
 static const int16 bagBounceTable[4] = {
@@ -118,7 +120,7 @@ void Inventory::updateVisibility() {
 }
 
 Common::Point Inventory::getPosition() {
-	return positionTable[_screenPositionIndex];
+	return Common::Point(positionTable[_screenPositionIndex].x, positionTable[_screenPositionIndex].y);
 }
 
 void Inventory::setActorFlag400() {


Commit: fdc9cbb6a3fa8d96aa541d7f0199dae52f6eaa32
    https://github.com/scummvm/scummvm/commit/fdc9cbb6a3fa8d96aa541d7f0199dae52f6eaa32
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T12:29:10+02:00

Commit Message:
DRAGONS: Fix another potential buffer overrun

Changed paths:
    engines/dragons/talk.cpp


diff --git a/engines/dragons/talk.cpp b/engines/dragons/talk.cpp
index 1c350e8785..a52f7a535a 100644
--- a/engines/dragons/talk.cpp
+++ b/engines/dragons/talk.cpp
@@ -70,7 +70,7 @@ void Talk::printWideText(byte *text) {
 	int i = 0;
 	for (; READ_LE_INT16(text) != 0 && i < 1999; i++) {
 		char c = *text;
-		if (c < 0x20) {
+		if (c < 0x20 && i < 1999-4) {
 			buf[i++] = '0';
 			buf[i++] = 'x';
 			buf[i++] = (c & 0xF0 >> 4) + '0';


Commit: 2a23de7f4f5fa403f6006ea011f179b09f9828a6
    https://github.com/scummvm/scummvm/commit/2a23de7f4f5fa403f6006ea011f179b09f9828a6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T12:30:58+02:00

Commit Message:
DRAGONS: Plug memory leak

Changed paths:
    engines/dragons/sound.cpp


diff --git a/engines/dragons/sound.cpp b/engines/dragons/sound.cpp
index a715d1ab53..f27e98600d 100644
--- a/engines/dragons/sound.cpp
+++ b/engines/dragons/sound.cpp
@@ -157,6 +157,7 @@ SoundManager::PSXAudioTrack::PSXAudioTrack(Common::SeekableReadStream *sector, A
 }
 
 SoundManager::PSXAudioTrack::~PSXAudioTrack() {
+	delete _audStream;
 }
 
 // Ha! It's palindromic!


Commit: af531d6fc792755b09faf82436dd0890365b91fe
    https://github.com/scummvm/scummvm/commit/af531d6fc792755b09faf82436dd0890365b91fe
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T12:35:06+02:00

Commit Message:
DRAGONS: Fix more memory leaks

Changed paths:
    engines/dragons/dragonflg.cpp
    engines/dragons/dragonimg.cpp
    engines/dragons/dragonrms.cpp
    engines/dragons/dragonrms.h


diff --git a/engines/dragons/dragonflg.cpp b/engines/dragons/dragonflg.cpp
index ce51d8ea1f..ddb63e7631 100644
--- a/engines/dragons/dragonflg.cpp
+++ b/engines/dragons/dragonflg.cpp
@@ -105,6 +105,7 @@ DragonFLG::DragonFLG(BigfileArchive *bigfileArchive) {
 
 DragonFLG::~DragonFLG() {
 	delete _data;
+	delete _properties;
 }
 
 bool DragonFLG::get(uint32 propertyId) {
diff --git a/engines/dragons/dragonimg.cpp b/engines/dragons/dragonimg.cpp
index e01ae533d7..c0108a30bb 100644
--- a/engines/dragons/dragonimg.cpp
+++ b/engines/dragons/dragonimg.cpp
@@ -57,6 +57,7 @@ DragonImg::DragonImg(BigfileArchive *bigfileArchive) {
 
 DragonImg::~DragonImg() {
 	delete _imgData;
+	delete[] _imgObjects;
 }
 
 Img *DragonImg::getImg(uint32 iptId) {
diff --git a/engines/dragons/dragonrms.cpp b/engines/dragons/dragonrms.cpp
index 27b7b7443f..addbb20b3d 100644
--- a/engines/dragons/dragonrms.cpp
+++ b/engines/dragons/dragonrms.cpp
@@ -50,6 +50,10 @@ DragonRMS::DragonRMS(BigfileArchive *bigfileArchive, DragonOBD *dragonOBD) : _dr
 	delete readStream;
 }
 
+DragonRMS::~DragonRMS() {
+	delete[] _rmsObjects;
+}
+
 char *DragonRMS::getSceneName(uint32 sceneId) {
 	return getRMS(sceneId)->_sceneName;
 }
diff --git a/engines/dragons/dragonrms.h b/engines/dragons/dragonrms.h
index 89f75712cf..c1f0b8cdb8 100644
--- a/engines/dragons/dragonrms.h
+++ b/engines/dragons/dragonrms.h
@@ -47,6 +47,7 @@ private:
 	DragonOBD *_dragonOBD;
 public:
 	DragonRMS(BigfileArchive *bigfileArchive, DragonOBD *dragonOBD);
+	~DragonRMS();
 	char *getSceneName(uint32 sceneId);
 	byte *getAfterSceneDataLoadedScript(uint32 sceneId);
 	byte *getBeforeSceneDataLoadedScript(uint32 sceneId);


Commit: 4c735979a699891551ff9e60835d3406b5fc62df
    https://github.com/scummvm/scummvm/commit/4c735979a699891551ff9e60835d3406b5fc62df
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T12:43:14+02:00

Commit Message:
DRAGONS: Initialize struct members on creation

Changed paths:
    engines/dragons/dragons.h


diff --git a/engines/dragons/dragons.h b/engines/dragons/dragons.h
index 42a62deec3..2141bc50ff 100644
--- a/engines/dragons/dragons.h
+++ b/engines/dragons/dragons.h
@@ -138,6 +138,9 @@ struct LoadingScreenState {
 		flameOffsetIdx = 0;
 		loadingFlamesUpdateCounter = 0;
 		loadingFlamesRiseCounter = 0;
+
+		memset(flames, 0, ARRAYSIZE(flames));
+		memset(quads, 0, ARRAYSIZE(quads));
 	}
 };
 




More information about the Scummvm-git-logs mailing list