Import: fixes #10983: Crash when trying to import a DXF file with Polish letters in the name

This commit is contained in:
wmayer
2023-10-10 10:25:52 +02:00
committed by wwmayer
parent dbe1c6135a
commit 4388246c01

View File

@@ -1809,7 +1809,11 @@ CDxfRead::CDxfRead(const char* filepath)
memset(m_block_name, '\0', sizeof(m_block_name));
m_ignore_errors = true;
m_ifs = new ifstream(filepath);
m_version = RUnknown;
m_CodePage = nullptr;
m_encoding = nullptr;
m_ifs = new Base::ifstream(Base::FileInfo(filepath));
if (!(*m_ifs)) {
m_fail = true;
printf("DXF file didn't load\n");
@@ -1817,9 +1821,6 @@ CDxfRead::CDxfRead(const char* filepath)
}
m_ifs->imbue(std::locale("C"));
m_version = RUnknown;
m_CodePage = nullptr;
m_encoding = nullptr;
stringToUTF8 = &CDxfRead::UTF8ToUTF8;
}