diff --git a/code/AssetLib/MDL/MDLMaterialLoader.cpp b/code/AssetLib/MDL/MDLMaterialLoader.cpp index 2de43d241..cbb69b697 100644 --- a/code/AssetLib/MDL/MDLMaterialLoader.cpp +++ b/code/AssetLib/MDL/MDLMaterialLoader.cpp @@ -448,7 +448,9 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7( unsigned int iType, unsigned int iWidth, unsigned int iHeight) { - std::unique_ptr pcNew; + if (szCurrent == nullptr) { + return; + } // get the type of the skin unsigned int iMasked = (unsigned int)(iType & 0xF); @@ -468,6 +470,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7( return; } + std::unique_ptr pcNew; pcNew.reset(new aiTexture); pcNew->mHeight = 0; pcNew->mWidth = iWidth;