Skip to content

Commit

Permalink
encode: honor secondheader.num_sections
Browse files Browse the repository at this point in the history
on empty num_sections.
  • Loading branch information
rurban committed Nov 21, 2023
1 parent f522359 commit 8b8d90d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2959,8 +2959,13 @@ dwg_encode (Dwg_Data *restrict dwg, Bit_Chain *restrict dat)
if (!dwg->header.num_sections
|| (dat->from_version >= R_2004 && dwg->header.num_sections > 6))
{
if (dwg->header.version < R_2000)
dwg->header.num_sections = dwg->auxheader.dwg_version ? 6 : 5;
if (dwg->header.version <= R_2000)
{
if (dwg->secondheader.num_sections)
dwg->header.num_sections = dwg->secondheader.num_sections;
else
dwg->header.num_sections = dwg->auxheader.dwg_version ? 6 : 5;
}
else
dwg->header.num_sections = 6;
// minimal DXF:
Expand Down

0 comments on commit 8b8d90d

Please sign in to comment.