Skip to content

LEADER entites are saved with code 76 doubled #60

@lordofbikes

Description

@lordofbikes

followup to LibreCAD/LibreCAD#875

The referenced LibreCAD issue is caused by LEADER entities without coordinates.

Means code 76 is 0 and AutoCAD abandon loading this file. Whereas other CAD software load the file by ignoring the malicious LEADER entity. This includes latest LibreCAD.

Investigating this LibreCAD issue brought up, that libdxfrw saves code 76 twice.

libdxfrw/src/libdxfrw.cpp

Lines 1043 to 1044 in 072aecd

writer->writeDouble(76, ent->vertnum);
writer->writeDouble(76, ent->vertexlist.size());

While this seems not to be a serious issue, it should be fixed anyhow.

It is also indicated, that the whole LEADER entity should be dropped on writing when ent->vertnum or ent->vertexlist.size() is less than 2.
This will not solve the cause of the LibreCAD issue, but it will avoid that AutoCAD rejects the file when the issue happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugminoradditional label to rate others

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions