MAINT-4796 FIXED Crash in LLModelLoader::loadFromSLM

meow-7.2.2
andreykproductengine 2015-04-24 20:30:26 +03:00
parent ce0c4853f1
commit a89f3f29a0
1 changed files with 6 additions and 1 deletions

View File

@ -2232,10 +2232,15 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
for (U32 lod = 0; lod < LLModel::NUM_LODS; ++lod)
{
if (!model[lod].empty())
if (model[lod].size() > idx)
{
instance_list[i].mLOD[lod] = model[lod][idx];
}
else if (!model[lod].empty())
{
// slm load failed - indexes are corrupted
return false;
}
}
instance_list[i].mModel = model[LLModel::LOD_HIGH][idx];