vcl/source/window/window.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0fbd1856e8a2ac36b152c6b5fc80038f86931359
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Mon May 15 13:33:11 2023 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue May 30 16:51:18 2023 +0200

    vcl: fix crash in Window::GetOutDev()
    
    Crashreport signature:
    
    program/libmergedlo.so
            rtl::Reference<vcl::WindowOutputDevice>::get() const
                    include/rtl/ref.hxx:208
    program/libmergedlo.so
            vcl::Window::GetOutDev()
                    vcl/source/window/window.cxx:574
    program/libswlo.so
            SwViewShell::ImplEndAction(bool)
                    sw/source/core/view/viewsh.cxx:294
    program/libswlo.so
            SwViewShell::EndAction(bool)
                    sw/inc/viewsh.hxx:611
    
    i.e. GetOutDev() is called on a disposed vcl::Window.
    
    Change-Id: I5b17225fced85c6804fc93fd12021c92966d3aa7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151857
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit 7952477debb9b7f10ec1e10bd6aac66a2e739b94)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151913
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit 88a96a67a16c8a951f28c6244d84a067b52ee0fa)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151914
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 5cfc50d717c0..9ac6614b3a97 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -571,7 +571,7 @@ Window::~Window()
 
 ::OutputDevice* Window::GetOutDev()
 {
-    return mpWindowImpl->mxOutDev.get();
+    return mpWindowImpl ? mpWindowImpl->mxOutDev.get() : nullptr;
 }
 
 Color WindowOutputDevice::GetBackgroundColor() const

Reply via email to