From 5e1188c44e1142cd5064de8459b8933cca5ad22a Mon Sep 17 00:00:00 2001 From: "Max Vollmer (Microsoft Havok)" <60260460+ms-maxvollmer@users.noreply.github.com> Date: Fri, 26 Nov 2021 13:01:38 +0000 Subject: [PATCH] Check that positions exist before accessing them --- include/assimp/Vertex.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/assimp/Vertex.h b/include/assimp/Vertex.h index ad5ff476c..f2e5572d3 100644 --- a/include/assimp/Vertex.h +++ b/include/assimp/Vertex.h @@ -135,7 +135,9 @@ public: /** Extract a particular vertex from a anim mesh and interleave all components */ explicit Vertex(const aiAnimMesh* msh, unsigned int idx) { ai_assert(idx < msh->mNumVertices); - position = msh->mVertices[idx]; + if (msh->HasPositions()) { + position = msh->mVertices[idx]; + } if (msh->HasNormals()) { normal = msh->mNormals[idx];