[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.
---
This change was previously made in 785cca1bb4
, as part of PR #3890, but was lost in a merge.
pull/3898/head
parent
7ff6144c2c
commit
00b625a2ae
|
@ -268,7 +268,8 @@ void AMFImporter::ParseFile(const std::string &pFile, IOSystem *pIOHandler) {
|
||||||
mXmlParser = new XmlParser();
|
mXmlParser = new XmlParser();
|
||||||
if (!mXmlParser->parse(file.get())) {
|
if (!mXmlParser->parse(file.get())) {
|
||||||
delete mXmlParser;
|
delete mXmlParser;
|
||||||
throw DeadlyImportError("Failed to create XML reader for file" + pFile + ".");
|
mXmlParser = nullptr;
|
||||||
|
throw DeadlyImportError("Failed to create XML reader for file ", pFile, ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start reading, search for root tag <amf>
|
// Start reading, search for root tag <amf>
|
||||||
|
|
Loading…
Reference in New Issue