From 08fd0dce60d7f4186afabefdf9977268291ec537 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Tue, 29 Oct 2019 20:51:35 +0000 Subject: [PATCH] Fix multiple OOB in L5tileFix Refs https://github.com/diasurgical/devilutionX/pull/401 --- Source/drlg_l1.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/drlg_l1.cpp b/Source/drlg_l1.cpp index 155118dcc..4b287d792 100644 --- a/Source/drlg_l1.cpp +++ b/Source/drlg_l1.cpp @@ -1186,6 +1186,9 @@ static void L5tileFix() { int i, j; + // BUGFIX: Bounds checks are required in all loop bodies. + // See https://github.com/diasurgical/devilutionX/pull/401 + for (j = 0; j < DMAXY; j++) { for (i = 0; i < DMAXX; i++) { if (dungeon[i][j] == 2 && dungeon[i + 1][j] == 22)