diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index edf8e46033..8f249c915c 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -55,6 +55,8 @@ #include #include +#include // for MAX_UNIT_COUNT_PER_PACKAGE definition + #define NULL_STRING "_NONAME_" /** @@ -1457,7 +1459,8 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg ) int multi = atoi( name1 ); - if( multi < 0 || multi > 26 ) + // Avoid out of range multi id: + if( multi < 0 || multi > MAX_UNIT_COUNT_PER_PACKAGE ) multi = 1; AddHierarchicalReference( path, ref, multi );