sw/source/uibase/docvw/HeaderFooterWin.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 24d8300c1b5a44c4b30c1e062b449df8507d80dc
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Thu May 19 14:17:10 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri May 20 15:43:49 2022 +0200

    sw: fix crash in SwHeaderFooterWin::IsEmptyHeaderFooter()
    
    Crashreport signature:
    
    Fatal signal received: SIGSEGV code: 1 for address: 0x0
    program/../program/libswlo.so
            SwPageFrame::GetPageDesc() const
                    sw/source/core/inc/pagefrm.hxx:144
    program/../program/libswlo.so
            SwHeaderFooterWin::IsEmptyHeaderFooter() const
                    sw/source/uibase/docvw/HeaderFooterWin.cxx:403
    program/../program/libswlo.so
            SwHeaderFooterWin::ShowAll(bool)
                    sw/source/uibase/docvw/HeaderFooterWin.cxx:273
    program/../program/libswlo.so
            SwFrameControl::ShowAll(bool)
                    sw/source/uibase/inc/FrameControl.hxx:49
    
    Change-Id: I3c1a6f46c7a15c2ca1a3db69a14d49abbea8c879
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134656
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    (cherry picked from commit 68da277559597c52833067c1749323ac38f3364a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134622
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx 
b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index d74c25084f14..99cdc0072861 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -399,6 +399,11 @@ bool SwHeaderFooterWin::IsEmptyHeaderFooter( ) const
 {
     bool bResult = true;
 
+    if (!GetPageFrame())
+    {
+        return bResult;
+    }
+
     // Actually check it
     const SwPageDesc* pDesc = GetPageFrame()->GetPageDesc();
 

Reply via email to