[Scummvm-git-logs] scummvm master -> a64eff92b8677213f12ca901de5a8b4f78128786
dreammaster
dreammaster at scummvm.org
Sun Nov 7 22:59:24 UTC 2021
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:
a64eff92b8 XEEN: fix out-of-bounds accesses
Commit: a64eff92b8677213f12ca901de5a8b4f78128786
https://github.com/scummvm/scummvm/commit/a64eff92b8677213f12ca901de5a8b4f78128786
Author: Benoit Pierre (benoit.pierre at gmail.com)
Date: 2021-11-07T14:59:21-08:00
Commit Message:
XEEN: fix out-of-bounds accesses
Changed paths:
engines/xeen/combat.cpp
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index b02c6aa41b..4a65ef6914 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -29,39 +29,56 @@
namespace Xeen {
-static const int MONSTER_GRID_X[48] = {
- 1, 1, 1, 0, -1, -1, -1, 1, 1, 1, 0, -1,
- -1, -1, 1, 1, 1, 0, -1, -1, -1, 1, 1, 1,
- 0, -1, -1, -1, 1, 1, 1, 0, -1, -1, -1, 1,
- 1, 1, 0, -1, -1, -1, 1, 1, 1, 0, -1, -1
+#define GRID_SIZE (7 * 7)
+
+static const int MONSTER_GRID_X[GRID_SIZE] = {
+ 1, 1, 1, 0, -1, -1, -1,
+ 1, 1, 1, 0, -1, -1, -1,
+ 1, 1, 1, 0, -1, -1, -1,
+ 1, 1, 1, 0, -1, -1, -1,
+ 1, 1, 1, 0, -1, -1, -1,
+ 1, 1, 1, 0, -1, -1, -1,
+ 1, 1, 1, 0, -1, -1, -1,
};
-static const int MONSTER_GRID_Y[48] = {
- 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0,
- 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0
+static const int MONSTER_GRID_Y[GRID_SIZE] = {
+ 0, 0, 0, -1, 0, 0, 0,
+ 0, 0, 0, -1, 0, 0, 0,
+ 0, 0, 0, -1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, +1, 0, 0, 0,
+ 0, 0, 0, +1, 0, 0, 0,
+ 0, 0, 0, +1, 0, 0, 0,
};
-static const int MONSTER_GRID3[48] = {
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- - 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1,
- 0, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+static const int MONSTER_GRID3[GRID_SIZE] = {
+ -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1,
+ +1, +1, +1, 0, -1, -1, -1,
+ +1, +1, +1, +1, +1, +1, +1,
+ +1, +1, +1, +1, +1, +1, +1,
+ +1, +1, +1, +1, +1, +1, +1,
};
-static const int MONSTER_GRID_BITINDEX1[48] = {
- 1, 1, 1, 2, 3, 3, 3, 1, 1, 1, 2, 3,
- 3, 3, 1, 1, 1, 2, 3, 3, 3, 1, 1, 1,
- 0, 3, 3, 3, 1, 1, 1, 0, 3, 3, 3, 1,
- 1, 1, 0, 3, 3, 3, 1, 1, 1, 0, 3, 3
+static const int MONSTER_GRID_BITINDEX1[GRID_SIZE] = {
+ 1, 1, 1, 2, 3, 3, 3,
+ 1, 1, 1, 2, 3, 3, 3,
+ 1, 1, 1, 2, 3, 3, 3,
+ 1, 1, 1, 0, 3, 3, 3,
+ 1, 1, 1, 0, 3, 3, 3,
+ 1, 1, 1, 0, 3, 3, 3,
+ 1, 1, 1, 0, 3, 3, 3,
};
-static const int MONSTER_GRID_BITINDEX2[48] = {
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1,
- 0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+static const int MONSTER_GRID_BITINDEX2[GRID_SIZE] = {
+ 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2,
+ 1, 1, 1, 0, 3, 3, 3,
+ 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0,
};
static const int ATTACK_TYPE_FX[23] = {
More information about the Scummvm-git-logs
mailing list