diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-13 15:12:18 +0000 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-01-16 15:53:45 +0000 |
commit | c6cbcf3b6f2c38acfd346abb712e5c4c622ad0a0 (patch) | |
tree | 1604897e1bc0d4c565532a5b5cfcc153ee6f0cff /filter/source | |
parent | 3f47b0b9d730be7ebc2e2844347180cdc59272b1 (diff) |
guard against self-recursive GetBoundingBox
Change-Id: If33f0e5e326604bf731d6ad50644e3a0b24ccf51
(cherry picked from commit 7420e350906558556881afc213f942d45d3e0b60)
Reviewed-on: https://gerrit.libreoffice.org/33050
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'filter/source')
-rw-r--r-- | filter/source/graphicfilter/idxf/dxfreprd.cxx | 7 | ||||
-rw-r--r-- | filter/source/graphicfilter/idxf/dxfreprd.hxx | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/filter/source/graphicfilter/idxf/dxfreprd.cxx b/filter/source/graphicfilter/idxf/dxfreprd.cxx index 4373e51a1698..93847e53acc4 100644 --- a/filter/source/graphicfilter/idxf/dxfreprd.cxx +++ b/filter/source/graphicfilter/idxf/dxfreprd.cxx @@ -132,11 +132,11 @@ void DXFPalette::SetColor(sal_uInt8 nIndex, sal_uInt8 nRed, sal_uInt8 nGreen, sa DXFRepresentation::DXFRepresentation() : mEnc(RTL_TEXTENCODING_DONTKNOW) + , mbInCalc(false) { setGlobalLineTypeScale(1.0); } - DXFRepresentation::~DXFRepresentation() { } @@ -293,6 +293,10 @@ void DXFRepresentation::ReadHeader(DXFGroupReader & rDGR) void DXFRepresentation::CalcBoundingBox(const DXFEntities & rEntities, DXFBoundingBox & rBox) { + if (mbInCalc) + return; + mbInCalc = true; + DXFBasicEntity * pBE=rEntities.pFirst; while (pBE!=nullptr) { switch (pBE->eType) { @@ -437,6 +441,7 @@ void DXFRepresentation::CalcBoundingBox(const DXFEntities & rEntities, } pBE=pBE->pSucc; } + mbInCalc = false; } namespace { diff --git a/filter/source/graphicfilter/idxf/dxfreprd.hxx b/filter/source/graphicfilter/idxf/dxfreprd.hxx index a7e15b274a33..2f8fc7af90e3 100644 --- a/filter/source/graphicfilter/idxf/dxfreprd.hxx +++ b/filter/source/graphicfilter/idxf/dxfreprd.hxx @@ -92,6 +92,8 @@ public: double mfGlobalLineTypeScale; // $LTSCALE + bool mbInCalc; // guard for self-recursive bounding box calc + DXFRepresentation(); ~DXFRepresentation(); |