avoid infinite loops in dxf rendering

Change-Id: Id2eb5540241f0792cde35c444fc2c0c5b7778353
This commit is contained in:
Caolán McNamara
2017-01-13 13:18:53 +00:00
parent cd8fdb46fd
commit 57779b5f3a
3 changed files with 17337 additions and 14 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -680,6 +680,10 @@ void DXF2GDIMetaFile::DrawDimensionEntity(const DXFDimensionEntity & rE, const D
void DXF2GDIMetaFile::DrawEntities(const DXFEntities & rEntities,
const DXFTransform & rTransform)
{
if (rEntities.mbBeingDrawn)
return;
rEntities.mbBeingDrawn = true;
sal_uLong nCount=0;
DXFTransform aET;
const DXFTransform * pT;
@@ -745,6 +749,8 @@ void DXF2GDIMetaFile::DrawEntities(const DXFEntities & rEntities,
pE=pE->pSucc;
nCount++;
}
rEntities.mbBeingDrawn = false;
}

View File

@@ -511,10 +511,19 @@ class DXFEntities {
public:
DXFEntities();
~DXFEntities();
DXFEntities()
: pFirst(nullptr)
, mbBeingDrawn(false)
{
}
~DXFEntities()
{
Clear();
}
DXFBasicEntity * pFirst; // list of entities, READ ONLY!
mutable bool mbBeingDrawn; // guard for loop in entity parsing
void Read(DXFGroupReader & rDGR);
// read entities per rGDR of a DXF file until a
@@ -525,18 +534,6 @@ public:
// deletes all entities
};
inline DXFEntities::DXFEntities()
{
pFirst=nullptr;
}
inline DXFEntities::~DXFEntities()
{
Clear();
}
#endif