From cc8374dd80821a423c41aa1ff85c98d12ca8e015 Mon Sep 17 00:00:00 2001 From: Alexandre Avenel Date: Sat, 21 Oct 2017 20:36:43 +0200 Subject: [PATCH] Return exception when obj file contains invalid face indice --- code/ObjFileParser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index acf275b94..4b203a8c2 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -475,7 +475,11 @@ void ObjFileParser::getFace( aiPrimitiveType type ) { } else { reportErrorTokenInFace(); } + } else { + //On error, std::atoi will return 0 which is not a valid value + throw DeadlyImportError("OBJ: Invalid face indice"); } + } m_DataIt += iStep; }