From 4d8028831bbf4daf4dec1744775d13778ea3e5d9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 29 Dec 2021 23:41:24 +0100 Subject: [PATCH] - fixed vertexscan crashing on bad walls. --- source/core/gamefuncs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index 74fd7d8f6..f2235178a 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -138,7 +138,8 @@ void vertexscan(walltype* startwall, func mark) while (true) { auto thelastwall = wal->lastWall(); - if (!thelastwall->twoSided()) break; + // thelastwall can be null here if the map is bogus. + if (!thelastwall || !thelastwall->twoSided()) break; wal = thelastwall->nextWall(); if (walbitmap.Check(wall.IndexOf(wal))) break;