From a1eeef3febad3ab69ceb77e06f0db9febbabf7fc Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Fri, 2 May 2014 17:52:52 -0700 Subject: [PATCH] Out-of-bounds check. --- libraries/fbx/src/FBXReader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/fbx/src/FBXReader.cpp b/libraries/fbx/src/FBXReader.cpp index 0bf203be02..ea97c2e789 100644 --- a/libraries/fbx/src/FBXReader.cpp +++ b/libraries/fbx/src/FBXReader.cpp @@ -715,7 +715,7 @@ void appendIndex(MeshData& data, QVector& indices, int index) { } else { int normalIndex = data.normalIndices.at(data.normalsByVertex ? vertexIndex : index); - if (normalIndex >= 0) { + if (normalIndex >= 0 && normalIndex < data.normals.size()) { normal = data.normals.at(normalIndex); } } @@ -726,7 +726,7 @@ void appendIndex(MeshData& data, QVector& indices, int index) { } } else { int texCoordIndex = data.texCoordIndices.at(index); - if (texCoordIndex >= 0) { + if (texCoordIndex >= 0 && texCoordIndex < data.texCoords.size()) { vertex.texCoord = data.texCoords.at(texCoordIndex); } }