[amf] Fix crash when file could not be parsed.
Fix double free of mXmlParser (deleted but not reset in ParseFile, then deleted again in ~AMFImporter). Should probably use a smart pointer instead, though. Partially addresses https://github.com/assimp/assimp/issues/3888.pull/3890/head
parent
1e89c06157
commit
785cca1bb4
|
@ -268,6 +268,7 @@ void AMFImporter::ParseFile(const std::string &pFile, IOSystem *pIOHandler) {
|
|||
mXmlParser = new XmlParser();
|
||||
if (!mXmlParser->parse(file.get())) {
|
||||
delete mXmlParser;
|
||||
mXmlParser = nullptr;
|
||||
throw DeadlyImportError("Failed to create XML reader for file" + pFile + ".");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue