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

Michael Stahl mstahl at redhat.com
Fri Jun 23 12:15:00 UTC 2017


 sw/source/core/layout/calcmove.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit f905d6056606234ba53a26a3e4105ad3560d4b7b
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jun 23 11:10:00 2017 +0200

    sw: fix UBSAN error in CppunitTest_sw_odfimport
    
    /sw/source/core/layout/calcmove.cxx:1686:43: runtime error: downcast of address 0x2ae9ba4566c0 which does not point to an object of type 'const SwFootnoteFrame'
    0x2ae9ba4566c0: note: object is of type 'SwSectionFrame'
    
    Footnotes can contain sections of course, so use FindFootnoteFrame().
    
    (regression from c83a443eb106e426901d0ba8a809eedcd24c42c5)
    
    Change-Id: I7824c81ba74ed3341f0ba5b14dac89d71f6318db
    Reviewed-on: https://gerrit.libreoffice.org/39157
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 2fdbb6b4f62f..662d1a5e61f8 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1683,7 +1683,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
         aRectFnSet.Refresh(this);
         if (!bMovedFwd && bFootnote && GetIndPrev() != pPre)
         {   // SwFlowFrame::CutTree() could have formatted and deleted pPre
-            auto const pPrevFootnoteFrame(static_cast<SwFootnoteFrame const*>(GetUpper())->GetMaster());
+            auto const pPrevFootnoteFrame(static_cast<SwFootnoteFrame const*>(
+                        FindFootnoteFrame())->GetMaster());
             bool bReset = true;
             if (pPrevFootnoteFrame)
             {   // use GetIndNext() in case there are sections


More information about the Libreoffice-commits mailing list