Pcbnew: fix crash when loading a file having vias on connected layers only.

It was due to an access out of bounds in a std::array
Fixes #14668
https://gitlab.com/kicad/code/kicad/issues/14668
This commit is contained in:
jean-pierre charras 2023-05-03 15:36:44 +02:00
parent 7eb099187d
commit 631dde3ed1
1 changed files with 8 additions and 2 deletions

View File

@ -4895,8 +4895,14 @@ PCB_VIA* PCB_PARSER::parsePCB_VIA()
break;
case T_zone_layer_connections:
for( PCB_LAYER_ID layer : via->GetLayerSet().Seq() )
{
// Ensure only copper layers are stored int ZoneLayerOverride array
LSET cuLayers = via->GetLayerSet() & LSET::AllCuMask();
for( PCB_LAYER_ID layer : cuLayers.Seq() )
{
via->SetZoneLayerOverride( layer, ZLO_FORCE_NO_ZONE_CONNECTION );
}
for( token = NextTok(); token != T_RIGHT; token = NextTok() )
{
@ -4907,7 +4913,7 @@ PCB_VIA* PCB_PARSER::parsePCB_VIA()
via->SetZoneLayerOverride( layer, ZLO_FORCE_FLASHED );
}
}
break;
case T_tstamp: