add more guards against out of bounds

This commit is contained in:
ZappoMan 2015-06-02 22:17:39 -07:00
parent ff54334fe1
commit 9e7f60e6a3

View file

@ -2360,6 +2360,11 @@ void Model::renderPart(RenderArgs* args, int meshIndex, int partIndex, bool tran
qint64 offset = 0;
// guard against partially loaded meshes
if (partIndex >= networkMesh.parts.size() || partIndex >= mesh.parts.size()) {
return;
}
const NetworkMeshPart& networkPart = networkMesh.parts.at(partIndex);
const FBXMeshPart& part = mesh.parts.at(partIndex);
model::MaterialPointer material = part._material;