summaryrefslogtreecommitdiffstats
path: root/lotuswordpro/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-01-04 21:04:40 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-01-05 11:18:55 +0100
commit1cb5b519a06709e22b99bec75d7bf95020442205 (patch)
tree6efac4e7f9c85d1bf3fac63f0008ab7a149e2e8c /lotuswordpro/source
parentUpdate gpgme to 1.16.0 (diff)
downloadcore-1cb5b519a06709e22b99bec75d7bf95020442205.tar.gz
core-1cb5b519a06709e22b99bec75d7bf95020442205.zip
ofz#42829 Timeout
Change-Id: I7c170fca4601fb0cee8acb28b65ce8bd59595911 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127974 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r--lotuswordpro/source/filter/lwpfnlayout.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/lotuswordpro/source/filter/lwpfnlayout.cxx b/lotuswordpro/source/filter/lwpfnlayout.cxx
index febf995acffc..b91b86a3dab1 100644
--- a/lotuswordpro/source/filter/lwpfnlayout.cxx
+++ b/lotuswordpro/source/filter/lwpfnlayout.cxx
@@ -244,20 +244,18 @@ LwpVirtualLayout* LwpEnSuperTableLayout::GetMainTableLayout()
{
LwpObjectID* pID = &GetChildTail();
- LwpVirtualLayout* pPrevLayout = nullptr;
+ o3tl::sorted_vector<LwpVirtualLayout*> aSeen;
while (!pID->IsNull())
{
LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(pID->obj().get());
- if (!pLayout || pLayout == pPrevLayout)
- {
+ if (!pLayout)
break;
- }
+ bool bAlreadySeen = !aSeen.insert(pLayout).second;
+ if (bAlreadySeen)
+ throw std::runtime_error("loop in conversion");
if (pLayout->GetLayoutType() == LWP_ENDNOTE_LAYOUT)
- {
return pLayout;
- }
pID = &pLayout->GetPrevious();
- pPrevLayout = pLayout;
}
return nullptr;