diff --git a/src/common/models/models_obj.cpp b/src/common/models/models_obj.cpp index 07bac6ea92a..1fa6d3181fe 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,