Skip to content

Commit c217291

Browse files
committed
indxf: fix empty CLASSES GH #1068
1 parent 479d834 commit c217291

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/in_dxf.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,16 +1686,21 @@ dxf_classes_read (Bit_Chain *restrict dat, Dwg_Data *restrict dwg)
16861686
klass = &dwg->dwg_class[i];
16871687
memset (klass, 0, sizeof (Dwg_Class));
16881688
if (pair != NULL && pair->code == 0 && pair->value.s
1689-
&& strEQc (pair->value.s, "CLASS"))
1689+
&& (strEQc (pair->value.s, "CLASS") || strEQc (pair->value.s, "ENDSEC")))
16901690
{
1691+
if (strEQc (pair->value.s, "ENDSEC"))
1692+
{
1693+
dxf_free_pair (pair);
1694+
return 0;
1695+
}
16911696
dxf_free_pair (pair);
16921697
pair = dxf_read_pair (dat);
16931698
if (!pair)
16941699
return 1;
16951700
}
16961701
else
16971702
{
1698-
LOG_ERROR ("2 CLASSES must be followed by 0 CLASS")
1703+
LOG_ERROR ("2 CLASSES must be followed by 0 CLASS or ENDSEC")
16991704
DXF_RETURN_EOF (DWG_ERR_INVALIDDWG);
17001705
return DWG_ERR_INVALIDDWG;
17011706
}

0 commit comments

Comments
 (0)