|
@@ -1406,10 +1406,13 @@ void Parser::ParseLV4MeshBonesVertices(unsigned int iNumVertices, ASE::Mesh &mes
|
|
if (TokenMatch(mFilePtr, "MESH_BONE_VERTEX", 16)) {
|
|
if (TokenMatch(mFilePtr, "MESH_BONE_VERTEX", 16)) {
|
|
// read the vertex index
|
|
// read the vertex index
|
|
unsigned int iIndex = strtoul10(mFilePtr, &mFilePtr);
|
|
unsigned int iIndex = strtoul10(mFilePtr, &mFilePtr);
|
|
- if (iIndex >= mesh.mBoneVertices.size()) {
|
|
|
|
- iIndex = (unsigned int)mesh.mBoneVertices.size() - 1;
|
|
|
|
|
|
+ if (mesh.mBoneVertices.empty()) {
|
|
|
|
+ SkipSection();
|
|
|
|
+ }
|
|
|
|
+ if (iIndex >= mesh.mBoneVertices.size() ) {
|
|
LogWarning("Bone vertex index is out of bounds. Using the largest valid "
|
|
LogWarning("Bone vertex index is out of bounds. Using the largest valid "
|
|
"bone vertex index instead");
|
|
"bone vertex index instead");
|
|
|
|
+ iIndex = (unsigned int)mesh.mBoneVertices.size() - 1;
|
|
}
|
|
}
|
|
|
|
|
|
// --- ignored
|
|
// --- ignored
|