aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner
diff options
context:
space:
mode:
authorEugene Sandulenko2018-03-29 00:01:17 +0200
committerEugene Sandulenko2018-03-29 00:08:34 +0200
commit0201979c55010c26b23863908fb278a61dcb766c (patch)
tree1f048d757658667163b125916bae4604597e26fc /engines/bladerunner
parentbfa00a02b1f1e286cc726054075e8426461df0a6 (diff)
downloadscummvm-rg350-0201979c55010c26b23863908fb278a61dcb766c.tar.gz
scummvm-rg350-0201979c55010c26b23863908fb278a61dcb766c.tar.bz2
scummvm-rg350-0201979c55010c26b23863908fb278a61dcb766c.zip
BLADERUNNER: Fix buffer overflow in PoliceMaze
Diffstat (limited to 'engines/bladerunner')
-rw-r--r--engines/bladerunner/script/police_maze.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/bladerunner/script/police_maze.cpp b/engines/bladerunner/script/police_maze.cpp
index aaed223a57..a85fa07451 100644
--- a/engines/bladerunner/script/police_maze.cpp
+++ b/engines/bladerunner/script/police_maze.cpp
@@ -186,15 +186,15 @@ void PoliceMazeTargetTrack::add(int trackId, float startX, float startY, float s
double coefY = (endY - startY) * coef;
double coefZ = (endZ - startZ) * coef;
- for (int i = 0; i < steps; i++) {
+ for (int i = 0; i < steps - 1; i++) {
_points[i].x = i * coefX + startX;
_points[i].y = i * coefY + startY;
_points[i].z = i * coefZ + startZ;
}
- _points[steps].x = endX;
- _points[steps].y = endY;
- _points[steps].z = endZ;
+ _points[steps - 1].x = endX;
+ _points[steps - 1].y = endY;
+ _points[steps - 1].z = endZ;
_isPaused = !isActive;
}