From 20ca6765399714bfa9ae25246546fe33f37602d7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 11 Jun 2021 23:20:50 +0200 Subject: [PATCH] - RR: fixed crash in function that handles acts of mass destruction (like blowing up gas stations.) With bad setups 'spr' could be left uninitialized. This crashed E1L1 of 'The Hickston Swamp' mod. --- source/games/duke/src/actors_r.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index c424e80fa..05a0c5268 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -4095,10 +4095,10 @@ void destroyit(DDukeActor *actor) { int lotag, hitag; int wi, wj; - DDukeActor* spr; int wallstart2, wallend2; int sectnum; int wallstart, wallend; + DDukeActor* spr = nullptr; hitag = 0; DukeSectIterator it1(actor->s->sectnum); @@ -4128,7 +4128,7 @@ void destroyit(DDukeActor *actor) } } } - if (spr->s->sectnum != it_sect) + if (spr && spr->s->sectnum != it_sect) if (lotag == a2->s->lotag) { sectnum = spr->s->sectnum;