7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-11 12:30:14 +00:00

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

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;
}