[Libreoffice-commits] core.git: lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Tue Jan 9 16:01:21 UTC 2018


 lotuswordpro/source/filter/lwpstory.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit e285d2fcf557c79c3dff46a10ec619ae5e227ab6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 9 13:57:24 2018 +0000

    ofz: avoid loop
    
    Change-Id: Ie97f06188e7f824f5c5fc8968efedc231a8b9418
    Reviewed-on: https://gerrit.libreoffice.org/47658
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx
index 19a1de7bf08e..48ef04d5af60 100644
--- a/lotuswordpro/source/filter/lwpstory.cxx
+++ b/lotuswordpro/source/filter/lwpstory.cxx
@@ -107,7 +107,10 @@ void LwpStory::XFConvert(XFContentContainer* pCont)
 
         //Get the xfcontainer for the next para
         pParaCont = xPara->GetXFContainer();
-        xPara.set(dynamic_cast<LwpPara*>(xPara->GetNext().obj().get()));
+        rtl::Reference<LwpPara> xNext(dynamic_cast<LwpPara*>(xPara->GetNext().obj().get()));
+        if (xPara == xNext)
+            throw std::runtime_error("loop in conversion");
+        xPara = xNext;
     }
 
     //process frame which anchor is to cell after converter all the para


More information about the Libreoffice-commits mailing list