From bf5c9413f980777d912c7abcc4e3a5e949a91cdb Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Wed, 1 Apr 2015 16:22:46 +0300 Subject: [PATCH] AC3D: Throw exception when encountering a bad vertex index --- code/ACLoader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/ACLoader.cpp b/code/ACLoader.cpp index fccec4e61..d3f45918a 100644 --- a/code/ACLoader.cpp +++ b/code/ACLoader.cpp @@ -632,6 +632,10 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object, face.mIndices[1] = cur++; // copy vertex positions + if (it2 == (*it).entries.end() ) { + throw DeadlyImportError("AC3D: Bad line"); + } + ai_assert((*it2).first < object.vertices.size()); *vertices++ = object.vertices[(*it2).first]; // copy texture coordinates