[Scummvm-git-logs] scummvm master -> 519f52a6351e2d7053a421d29fbf89b20e3f3f86

dreammaster dreammaster at scummvm.org
Tue Feb 13 03:20:44 CET 2018


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

Summary:
519f52a635 XEEN: Fix Valgrind reported issues


Commit: 519f52a6351e2d7053a421d29fbf89b20e3f3f86
    https://github.com/scummvm/scummvm/commit/519f52a6351e2d7053a421d29fbf89b20e3f3f86
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-02-12T21:20:45-05:00

Commit Message:
XEEN: Fix Valgrind reported issues

Changed paths:
    engines/xeen/combat.cpp
    engines/xeen/map.cpp


diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index 8afe48d..e7502d6 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -467,7 +467,8 @@ void Combat::moveMonsters() {
 
 	for (uint idx = 0; idx < map._mobData._monsters.size(); ++idx) {
 		MazeMonster &monster = map._mobData._monsters[idx];
-		if (monster._position.y < 32) {
+		if ((uint)monster._position.y < 32) {
+			assert((uint)monster._position.x < 32);
 			_monsterMap[monster._position.y][monster._position.x]++;
 		}
 	}
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index aab806f..f3c00dd 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -112,6 +112,7 @@ MonsterStruct::MonsterStruct(Common::String name, int experience, int hp, int ar
 
 void MonsterStruct::synchronize(Common::SeekableReadStream &s) {
 	char name[16];
+	Common::fill(name, name + 16, '\0');
 	s.read(name, 16);
 	name[15] = '\0';
 	_name = Common::String(name);
@@ -147,6 +148,7 @@ void MonsterStruct::synchronize(Common::SeekableReadStream &s) {
 	_fx = s.readByte();
 
 	char attackVoc[10];
+	Common::fill(attackVoc, attackVoc + 10, '\0');
 	s.read(attackVoc, 9);
 	attackVoc[9] = '\0';
 	_attackVoc = Common::String(attackVoc);





More information about the Scummvm-git-logs mailing list