lotuswordpro/source/filter/lwppagelayout.cxx | 7 +++++++ 1 file changed, 7 insertions(+)
New commits: commit 7422ef83a1304d34cd303a7160efd4e76cc44a49 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Oct 16 14:04:35 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat Oct 16 20:36:40 2021 +0200 ofz#40004 Timeout Change-Id: I261f6acec53936e4a644bb4b38bbc41fa9ad120c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123702 Tested-by: Jenkins Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx index 0a72db8f7d30..735a0791c2e2 100644 --- a/lotuswordpro/source/filter/lwppagelayout.cxx +++ b/lotuswordpro/source/filter/lwppagelayout.cxx @@ -607,8 +607,11 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 nLayoutNumber) //get first pagehint LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetHead().obj().get()); + o3tl::sorted_vector<LwpPageHint*> aSeen; while (pPageHint) { + aSeen.insert(pPageHint); + if (GetObjectID() == pPageHint->GetPageLayoutID()) { sal_uInt16 nNumber = pPageHint->GetPageNumber(); @@ -635,7 +638,11 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 nLayoutNumber) break; } } + pPageHint = dynamic_cast<LwpPageHint*>(pPageHint->GetNext().obj().get()); + + if (aSeen.find(pPageHint) != aSeen.end()) + throw std::runtime_error("loop in conversion"); } if (nPageNumber >= 0) {