From 453a4cc8b18ef93bf0e8143729fa0dbbc36f1166 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 30 Oct 2018 13:35:15 +0100 Subject: [PATCH] - fix null pointer crash --- src/lightmap/mapdata.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lightmap/mapdata.cpp b/src/lightmap/mapdata.cpp index b3f3ca7..335e55c 100644 --- a/src/lightmap/mapdata.cpp +++ b/src/lightmap/mapdata.cpp @@ -334,6 +334,8 @@ bool FLevel::PointInsideSubSector(const float x, const float y, const MapSubsect kexVec2 pt1, pt2; surf = leafSurfaces[0][sub - GLSubsectors]; + if (!surf) + return false; // check to see if the point is inside the subsector leaf for (i = 0; i < surf->numVerts; i++)