From fd926a8ffec365ebda3bf7cd55daa4b134f752bf Mon Sep 17 00:00:00 2001 From: KJeff01 Date: Mon, 26 Feb 2024 19:30:33 -0600 Subject: [PATCH] Prevent crash if IMD is bad for renderExplosionEffect() --- src/effects.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/effects.cpp b/src/effects.cpp index 9efe9b46db3..776ee717477 100644 --- a/src/effects.cpp +++ b/src/effects.cpp @@ -1534,6 +1534,11 @@ static void renderExplosionEffect(const EFFECT *psEffect, const glm::mat4 &viewM { const PIELIGHT brightness = WZCOL_WHITE; + if (psEffect == nullptr || psEffect->imd == nullptr) + { + return; + } + if (psEffect->type == EXPLOSION_TYPE_LAND_LIGHT) { if (rejectLandLight((LAND_LIGHT_SPEC)psEffect->specific))