Explorar o código

Return exception when obj file contains invalid face indice

Alexandre Avenel %!s(int64=8) %!d(string=hai) anos
pai
achega
cc8374dd80
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      code/ObjFileParser.cpp

+ 4 - 0
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;
     }