From b8146e323c9e0fff71738f87ae1407d06dd21a23 Mon Sep 17 00:00:00 2001 From: RaveYard <29225776+MrRaveYard@users.noreply.github.com> Date: Mon, 18 Sep 2023 11:52:44 +0200 Subject: [PATCH] Fix nullptr crash in HWWall::BuildFFBlock --- src/rendering/hwrenderer/scene/hw_walls.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rendering/hwrenderer/scene/hw_walls.cpp b/src/rendering/hwrenderer/scene/hw_walls.cpp index 41fe0ac3dc..49fda8942e 100644 --- a/src/rendering/hwrenderer/scene/hw_walls.cpp +++ b/src/rendering/hwrenderer/scene/hw_walls.cpp @@ -1658,9 +1658,9 @@ void HWWall::BuildFFBlock(HWDrawInfo *di, FRenderState& state, seg_t * seg, F3DF lightmap = nullptr; if (seg->sidedef == seg->linedef->sidedef[0]) - lightmap = seg->linedef->sidedef[1]->lightmap[4 + roverIndex]; + lightmap = seg->linedef->sidedef[1]->lightmap ? seg->linedef->sidedef[1]->lightmap[4 + roverIndex] : nullptr; else - lightmap = seg->linedef->sidedef[0]->lightmap[4 + roverIndex]; + lightmap = seg->linedef->sidedef[0]->lightmap ? seg->linedef->sidedef[0]->lightmap[4 + roverIndex] : nullptr; if (rover->flags&FF_FOG) {