Kaydet (Commit) 20bb7988 authored tarafından Caolán McNamara's avatar Caolán McNamara

crashtesting: infinite recurse with moz384637-1.svg

Change-Id: Ia4bbc9d471c63812dc3ef490f32e8490bda72bfe
Reviewed-on: https://gerrit.libreoffice.org/57888
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst f5930a22
...@@ -114,6 +114,8 @@ namespace svgio ...@@ -114,6 +114,8 @@ namespace svgio
/// possible local CssStyle, e.g. style="fill:red; stroke:red;" /// possible local CssStyle, e.g. style="fill:red; stroke:red;"
std::unique_ptr<SvgStyleAttributes> mpLocalCssStyle; std::unique_ptr<SvgStyleAttributes> mpLocalCssStyle;
mutable bool mbDecomposing;
// flag if maCssStyleVector is already computed (done only once) // flag if maCssStyleVector is already computed (done only once)
bool mbCssStyleVectorBuilt : 1; bool mbCssStyleVectorBuilt : 1;
......
...@@ -267,6 +267,7 @@ namespace svgio ...@@ -267,6 +267,7 @@ namespace svgio
maDisplay(Display_inline), maDisplay(Display_inline),
maCssStyleVector(), maCssStyleVector(),
mpLocalCssStyle(nullptr), mpLocalCssStyle(nullptr),
mbDecomposing(false),
mbCssStyleVectorBuilt(false) mbCssStyleVectorBuilt(false)
{ {
OSL_ENSURE(SVGTokenUnknown != maType, "SvgNode with unknown type created (!)"); OSL_ENSURE(SVGTokenUnknown != maType, "SvgNode with unknown type created (!)");
...@@ -464,6 +465,9 @@ namespace svgio ...@@ -464,6 +465,9 @@ namespace svgio
void SvgNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const void SvgNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const
{ {
if (mbDecomposing) //guard against infinite recurse
return;
if(Display_none == getDisplay()) if(Display_none == getDisplay())
{ {
return; return;
...@@ -499,6 +503,8 @@ namespace svgio ...@@ -499,6 +503,8 @@ namespace svgio
if(!rChildren.empty()) if(!rChildren.empty())
{ {
mbDecomposing = true;
const sal_uInt32 nCount(rChildren.size()); const sal_uInt32 nCount(rChildren.size());
for(sal_uInt32 a(0); a < nCount; a++) for(sal_uInt32 a(0); a < nCount; a++)
...@@ -571,6 +577,7 @@ namespace svgio ...@@ -571,6 +577,7 @@ namespace svgio
} }
} }
} }
mbDecomposing = false;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment