From d1ea33a81573bdec8f3392efb6ee8ffc8da8a834 Mon Sep 17 00:00:00 2001 From: Chernoskill Date: Sat, 6 Mar 2021 11:27:23 +0100 Subject: [PATCH] Update models_obj.cpp --- src/common/models/models_obj.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/models/models_obj.cpp b/src/common/models/models_obj.cpp index 07bac6ea92..1fa6d3181f 100644 --- a/src/common/models/models_obj.cpp +++ b/src/common/models/models_obj.cpp @@ -636,7 +636,7 @@ void FOBJModel::RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int f OBJSurface *surf = &surfaces[i]; FGameTexture *userSkin = skin; - if (!userSkin) + if (!userSkin && curSpriteMDLFrame) { int ssIndex = i + curMDLIndex * MD3_MAX_SURFACES; if (i < MD3_MAX_SURFACES && curSpriteMDLFrame->surfaceskinIDs[ssIndex].isValid()) @@ -671,7 +671,7 @@ void FOBJModel::AddSkins(uint8_t* hitlist) for (size_t i = 0; i < surfaces.Size(); i++) { size_t ssIndex = i + curMDLIndex * MD3_MAX_SURFACES; - if (i < MD3_MAX_SURFACES && curSpriteMDLFrame->surfaceskinIDs[ssIndex].isValid()) + if (curSpriteMDLFrame && i < MD3_MAX_SURFACES && curSpriteMDLFrame->surfaceskinIDs[ssIndex].isValid()) { // Precache skins manually reassigned by the user. // On OBJs with lots of skins, such as Doom map OBJs exported from GZDB,