File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments