diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-01-04 21:04:40 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-01-05 11:18:55 +0100 |
commit | 1cb5b519a06709e22b99bec75d7bf95020442205 (patch) | |
tree | 6efac4e7f9c85d1bf3fac63f0008ab7a149e2e8c | |
parent | 78dae8b20b85686d1a642415195d2e10fbb2dc1f (diff) |
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>
-rw-r--r-- | lotuswordpro/source/filter/lwpfnlayout.cxx | 12 |
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; |