lotuswordpro/source/filter/lwpfnlayout.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
New commits: commit 1cb5b519a06709e22b99bec75d7bf95020442205 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Jan 4 21:04:40 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Jan 5 11:18:55 2022 +0100 ofz#42829 Timeout Change-Id: I7c170fca4601fb0cee8acb28b65ce8bd59595911 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127974 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> 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;