From 7642bbc090c8115c2267d6427f4951108f7eb4fc Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Tue, 20 Oct 2020 10:22:24 +0200 Subject: [PATCH] altium: Via record can have size=74, which was not supported by us Fix: https://gitlab.com/kicad/code/kicad/-/issues/5543 --- pcbnew/plugins/altium/altium_parser_pcb.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pcbnew/plugins/altium/altium_parser_pcb.cpp b/pcbnew/plugins/altium/altium_parser_pcb.cpp index 9113a12895..aa5cb6cf85 100644 --- a/pcbnew/plugins/altium/altium_parser_pcb.cpp +++ b/pcbnew/plugins/altium/altium_parser_pcb.cpp @@ -800,7 +800,7 @@ AVIA6::AVIA6( ALTIUM_PARSER& aReader ) } // Subrecord 1 - aReader.ReadAndSetSubrecordLength(); + size_t subrecord1 = aReader.ReadAndSetSubrecordLength(); aReader.Skip( 1 ); @@ -821,8 +821,16 @@ AVIA6::AVIA6( ALTIUM_PARSER& aReader ) layer_start = static_cast( aReader.Read() ); layer_end = static_cast( aReader.Read() ); - aReader.Skip( 43 ); - viamode = static_cast( aReader.Read() ); + + if( subrecord1 <= 74 ) + { + viamode = ALTIUM_PAD_MODE::SIMPLE; + } + else + { + aReader.Skip( 43 ); + viamode = static_cast( aReader.Read() ); + } aReader.SkipSubrecord();