SL-17828 Crash at LLPolyMorphData::loadBinary

These files are usually prepackaged with viewer, either all issues should lead to an error or all issues should use warns. I don't think it is a critical issue, so instead of crashing, printing out filename.
master
Andrey Kleshchev 2022-07-26 21:43:44 +03:00
parent faeded3657
commit 2a48c19530
2 changed files with 8 additions and 4 deletions

View File

@ -612,14 +612,16 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
// we reached the end of the morphs
break;
}
LLPolyMorphData* morph_data = new LLPolyMorphData(std::string(morphName));
std::string morph_name(morphName);
LLPolyMorphData* morph_data = new LLPolyMorphData(morph_name);
BOOL result = morph_data->loadBinary(fp, this);
if (!result)
{
delete morph_data;
continue;
LL_WARNS() << "Failure loading " << morph_name << " from " << fileName << LL_ENDL;
delete morph_data;
continue;
}
mMorphData.insert(morph_data);

View File

@ -156,7 +156,9 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
if (mVertexIndices[v] > 10000)
{
LL_ERRS() << "Bad morph index: " << mVertexIndices[v] << LL_ENDL;
// Bad install? These are usually .llm files from 'character' fodler
LL_WARNS() << "Bad morph index " << v << ": " << mVertexIndices[v] << LL_ENDL;
return FALSE;
}