Avoid Cvpcb crash from malformed fp libraries (namely converted from Eagle) when the fp names are not coded using ASCII/UTF8 code.

This commit is contained in:
jean-pierre charras 2015-07-17 15:13:31 +02:00
parent 40ccc0bedf
commit 3e0334a972
1 changed files with 10 additions and 5 deletions

View File

@ -101,6 +101,10 @@ void FOOTPRINT_INFO::load()
std::auto_ptr<MODULE> m( fptable->FootprintLoad( m_nickname, m_fpname ) ); std::auto_ptr<MODULE> m( fptable->FootprintLoad( m_nickname, m_fpname ) );
if( m.get() == NULL ) // Should happen only with malformed/broken libraries
m_pad_count = 0;
else
{
m_pad_count = m->GetPadCount( DO_NOT_INCLUDE_NPTH ); m_pad_count = m->GetPadCount( DO_NOT_INCLUDE_NPTH );
m_keywords = m->GetKeywords(); m_keywords = m->GetKeywords();
m_doc = m->GetDescription(); m_doc = m->GetDescription();
@ -108,6 +112,7 @@ void FOOTPRINT_INFO::load()
// tell ensure_loaded() I'm loaded. // tell ensure_loaded() I'm loaded.
m_loaded = true; m_loaded = true;
} }
}
#define JOBZ 6 // no. libraries per worker thread. It takes about #define JOBZ 6 // no. libraries per worker thread. It takes about