aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-05-18 12:37:56 +0200
committerEugene Sandulenko2016-05-18 12:38:15 +0200
commit843694933dd8c0e31a8964910730f4ce9d6b3995 (patch)
treed21bc23e5a9ea5c647bddd4168473af66aa83948
parentb0d90ccccf2c16694dca6ab2a1019cd7c4bd9c33 (diff)
downloadscummvm-rg350-843694933dd8c0e31a8964910730f4ce9d6b3995.tar.gz
scummvm-rg350-843694933dd8c0e31a8964910730f4ce9d6b3995.tar.bz2
scummvm-rg350-843694933dd8c0e31a8964910730f4ce9d6b3995.zip
TINSEL: Fix out-of-bounds array access
-rw-r--r--engines/tinsel/dialogs.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index ad20253b9c..b5d090ec15 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -4617,9 +4617,9 @@ extern void Xmovement(int x) {
GetAniPosition(g_objArray[0], &g_InvD[g_ino].inventoryX, &aniY);
g_InvD[g_ino].inventoryX +=x;
MultiSetAniX(g_objArray[0], g_InvD[g_ino].inventoryX);
- for (i = 1; g_objArray[i] && i < MAX_WCOMP; i++)
+ for (i = 1; i < MAX_WCOMP && g_objArray[i]; i++)
MultiMoveRelXY(g_objArray[i], x, 0);
- for (i = 0; g_iconArray[i] && i < MAX_ICONS; i++)
+ for (i = 0; i < MAX_ICONS && g_iconArray[i]; i++)
MultiMoveRelXY(g_iconArray[i], x, 0);
break;
@@ -4665,9 +4665,9 @@ extern void Ymovement(int y) {
GetAniPosition(g_objArray[0], &aniX, &g_InvD[g_ino].inventoryY);
g_InvD[g_ino].inventoryY +=y;
MultiSetAniY(g_objArray[0], g_InvD[g_ino].inventoryY);
- for (i = 1; g_objArray[i] && i < MAX_WCOMP; i++)
+ for (i = 1; i < MAX_WCOMP && g_objArray[i]; i++)
MultiMoveRelXY(g_objArray[i], 0, y);
- for (i = 0; g_iconArray[i] && i < MAX_ICONS; i++)
+ for (i = 0; i < MAX_ICONS && g_iconArray[i]; i++)
MultiMoveRelXY(g_iconArray[i], 0, y);
break;