Return exception when obj file contains invalid face indice
authorAlexandre Avenel <avenel.alexandre@gmail.com>
Sat, 21 Oct 2017 18:36:43 +0000 (20:36 +0200)
committerAlexandre Avenel <avenel.alexandre@gmail.com>
Sat, 21 Oct 2017 18:58:00 +0000 (20:58 +0200)
code/ObjFileParser.cpp

index acf275b..4b203a8 100644 (file)
@@ -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;
     }