Catch oom for graphics importer

Because DXFs and SVGs could be nasty sized
This commit is contained in:
Marek Roszko 2021-05-01 14:26:47 -04:00
parent e955f83c51
commit c4801a4dd4
1 changed files with 14 additions and 1 deletions

View File

@ -63,5 +63,18 @@ bool GRAPHICS_IMPORTER::Import( double aScale )
m_plugin->SetImporter( this );
return m_plugin->Import();
bool success = false;
try
{
success = m_plugin->Import();
}
catch( const std::bad_alloc& )
{
// Memory exhaustion
// TODO report back an error message
return false;
}
return success;
}