Skip to content

Commit

Permalink
dwg_next_entity: fix immediate cycles
Browse files Browse the repository at this point in the history
but we cannot yet detect non-immediate cycles, as from
illegal, fuzzed DWGs. See GH #345
  • Loading branch information
rurban committed Feb 6, 2022
1 parent 84c34be commit 4f431cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dwg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,10 @@ dwg_next_entity (const Dwg_Object *restrict obj)
goto next_obj;
next = obj->tio.entity->next_entity;
if (next && next->absolute_ref)
return dwg_ref_object_silent (obj->parent, next);
{
Dwg_Object *next_obj = dwg_ref_object_silent (obj->parent, next);
return (obj == next_obj) ? NULL : next_obj;
}
else
goto next_obj;
}
Expand Down

0 comments on commit 4f431cc

Please sign in to comment.