altium importer: Fix size of record

Previous size led to incorrect import of some boards.

From https://gitlab.com/kicad/code/kicad/-/merge_requests/172
This commit is contained in:
Stefan 2020-04-18 01:00:11 +00:00 committed by Ian McInerney
parent 1ba4710ab0
commit 8abe07f6e7
1 changed files with 3 additions and 4 deletions

View File

@ -599,9 +599,8 @@ APAD6::APAD6( ALTIUM_PARSER& aReader )
// Subrecord 5
size_t subrecord5 = aReader.ReadAndSetSubrecordLength();
// TODO: exact minimum length we know?
if( subrecord5 < 120 )
THROW_IO_ERROR( "Pads6 stream subrecord has length < 120, which is unexpected" );
if( subrecord5 < 114 )
THROW_IO_ERROR( "Pads6 stream subrecord has length < 114, which is unexpected" );
layer = static_cast<ALTIUM_LAYER>( aReader.Read<uint8_t>() );
tolayer = ALTIUM_LAYER::UNKNOWN;
@ -644,7 +643,7 @@ APAD6::APAD6( ALTIUM_PARSER& aReader )
aReader.Skip( 3 );
holerotation = aReader.Read<double>();
if( subrecord5 == 120 )
if( subrecord5 >= 120 )
{
tolayer = static_cast<ALTIUM_LAYER>( aReader.Read<uint8_t>() );
aReader.Skip( 2 );