diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-09 15:06:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-10 17:39:46 +0100 |
commit | a9847cb1a5d231226eac58e22a4fe2705707817e (patch) | |
tree | 9d5fb24d7e05131e8b3004fa38b6e2184ca58078 | |
parent | f7676f9755ab187be4d695d2630c8a6795a4904a (diff) |
ofz: Infinite loop
Change-Id: I9344cb70aab0fbaa194d431928eba9806d76f115
Reviewed-on: https://gerrit.libreoffice.org/49504
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | lotuswordpro/source/filter/lwptablelayout.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx index f8793328cd9b..eb94eaea6758 100644 --- a/lotuswordpro/source/filter/lwptablelayout.cxx +++ b/lotuswordpro/source/filter/lwptablelayout.cxx @@ -82,6 +82,7 @@ #include "lwpframelayout.hxx" #include <xfilter/xfparastyle.hxx> #include <memory> +#include <set> LwpSuperTableLayout::LwpSuperTableLayout(LwpObjectHeader const &objHdr, LwpSvStream* pStrm) : LwpPlacableLayout(objHdr, pStrm) @@ -230,8 +231,10 @@ double LwpSuperTableLayout::GetTableWidth() LwpObjectID& rColumnID = pTableLayout->GetColumnLayoutHead(); LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColumnID.obj().get()); double dColumnWidth = dDefaultWidth; + std::set<LwpColumnLayout*> aSeen; while (pColumnLayout) { + aSeen.insert(pColumnLayout); if(pColumnLayout->GetColumnID() == i) { dColumnWidth = pColumnLayout->GetWidth(); @@ -239,6 +242,8 @@ double LwpSuperTableLayout::GetTableWidth() } rColumnID = pColumnLayout->GetNext(); pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColumnID.obj().get()); + if (aSeen.find(pColumnLayout) != aSeen.end()) + throw std::runtime_error("loop in conversion"); } dWidth += dColumnWidth; } |