avoid infinite loops in dxf rendering
Change-Id: Id2eb5540241f0792cde35c444fc2c0c5b7778353
This commit is contained in:
17320
filter/qa/cppunit/data/dxf/pass/loop-1.dxf
Normal file
17320
filter/qa/cppunit/data/dxf/pass/loop-1.dxf
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user