diff --git a/pcbnew/import_gfx/graphics_importer.cpp b/pcbnew/import_gfx/graphics_importer.cpp index 6192df1f2e..d51bcced3b 100644 --- a/pcbnew/import_gfx/graphics_importer.cpp +++ b/pcbnew/import_gfx/graphics_importer.cpp @@ -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; }