From ec5762f024dabe609a6cd25231694fc09212394f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 Oct 2020 01:17:41 +0200 Subject: [PATCH] - do not use index 0 of Blood's X arrays. This can be written to through uninitialized data and break things quite badly. --- source/blood/src/db.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blood/src/db.cpp b/source/blood/src/db.cpp index 786a09aea..e60abb458 100644 --- a/source/blood/src/db.cpp +++ b/source/blood/src/db.cpp @@ -333,7 +333,7 @@ void dbInit(void) { xsprite[i].reference = -1; } - XWallsUsed = XSectorsUsed = 0; + XWallsUsed = XSectorsUsed = 1; // 0 is not usable because it's the default for 'extra' and some code actually uses it to clobber the contents in here. :( for (int i = 1; i < kMaxXWalls; i++) { xwall[i].reference = -1;