Fix memory leak in case of an error.

pull/1538/head
Kim Kulling 2017-11-04 17:05:23 +01:00
parent 4879fe13ca
commit c9ada44ab5
1 changed files with 2 additions and 0 deletions

View File

@ -477,6 +477,8 @@ void ObjFileParser::getFace( aiPrimitiveType type ) {
}
} else {
//On error, std::atoi will return 0 which is not a valid value
delete m_pModel;
m_pModel = nullptr;
throw DeadlyImportError("OBJ: Invalid face indice");
}