Fix segfault #2614

This commit is contained in:
Gordon MacPherson
2019-08-26 22:44:25 +01:00
parent 5fe728345f
commit 7e12257ebc

View File

@@ -610,7 +610,10 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector<int>& materials_out, cons
const std::string& ReferenceInformationType)
{
const size_t face_count = m_faces.size();
ai_assert(face_count);
if(face_count <= 0)
{
return;
}
// materials are handled separately. First of all, they are assigned per-face
// and not per polyvert. Secondly, ReferenceInformationType=IndexToDirect