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