summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-01-29 20:56:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-01-30 10:05:51 +0100
commitaa57442687b936fe862e73449ca39873888b9539 (patch)
treef32d63ed0b49df56c3e186c5007503d21b5bc3d1 /lotuswordpro
parent85a7a319bfffb1f709ed504cfadea3bbef077ec1 (diff)
ofz#5313 Timeout
Change-Id: I5a51bf241d1a3c3c04b4f46cd26d2afab518787c Reviewed-on: https://gerrit.libreoffice.org/48854 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpdoc.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx
index f12838a07095..72921cbae903 100644
--- a/lotuswordpro/source/filter/lwpdoc.cxx
+++ b/lotuswordpro/source/filter/lwpdoc.cxx
@@ -68,6 +68,7 @@
#include "lwpverdocument.hxx"
#include <xfilter/xfstylemanager.hxx>
#include <osl/thread.h>
+#include <set>
LwpDocument::LwpDocument(LwpObjectHeader const & objHdr, LwpSvStream* pStrm)
: LwpDLNFPVList(objHdr, pStrm)
@@ -644,11 +645,15 @@ LwpDocument* LwpDocument::GetPreviousDivision()
{
LwpDocument* pRoot = GetRootDocument();
LwpDocument *pLastDoc = pRoot ? pRoot->GetLastDivisionWithContents() : nullptr;
+ std::set<LwpDocument*> aSeen;
while (pLastDoc)
{
+ if (aSeen.find(pLastDoc) != aSeen.end())
+ throw std::runtime_error("loop in conversion");
if (pLastDoc->GetEnSuperTableLayout().is())
return pLastDoc;
pLastDoc = pLastDoc->GetPreviousDivisionWithContents();
+ aSeen.insert(pLastDoc);
}
return nullptr;