vcl/source/window/window3.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 1295edaaa41b392ec7669df59fda51881a4f2c41
Author:     Miklos Vajna <[email protected]>
AuthorDate: Tue Feb 17 16:56:34 2026 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Thu Feb 19 18:32:36 2026 +0100

    vcl: fix crash in Window::GetOutputSizePixel()
    
    gdb on the crashreport core dump:
    
            #0  OutputDevice::GetOutputSizePixel (this=0x0) at 
include/vcl/outdev.hxx:324
            #1  vcl::Window::GetOutputSizePixel (this=this@entry=0x5479f1e0) at 
vcl/source/window/window3.cxx:90
            #2  0x0000733bcba58cca in vcl::RoadmapWizard::ImplPosCtrls 
(this=0x5479f1e0)
                at vcl/source/control/wizardmachine.cxx:135
            #3  0x0000733bcba5c25d in 
vcl::RoadmapWizard::ImplHandleWizardLayoutTimerHdl (this=0x5479f1e0)
                at vcl/source/control/wizardmachine.cxx:129
            #4  vcl::RoadmapWizard::LinkStubImplHandleWizardLayoutTimerHdl 
(instance=0x5479f1e0, data=<optimized out>)
                at vcl/source/control/wizardmachine.cxx:127
            #5  0x0000733bc8df817d in Scheduler::CallbackTaskScheduling () at 
vcl/source/app/scheduler.cxx:585
    
    and
    
            (gdb) up
            #1  vcl::Window::GetOutputSizePixel (this=this@entry=0x5479f1e0) at 
vcl/source/window/window3.cxx:90
            90      Size Window::GetOutputSizePixel() const { return 
GetOutDev()->GetOutputSizePixel(); }
            (gdb) print mpWindowImpl
            $2 = std::unique_ptr<WindowImpl> = {get() = 0x0}
    
    I.e. this is similar to commit e66599cc396a79e4fc0f59ee256148bc00ca6e15
    (vcl: fix crash in Window::ImplInvalidate(), 2025-11-18), you can't
    assume mpWindowImpl is a non-nullptr here.
    
    Change-Id: I09c93f568c96cf52369f4eef1798c84f230b880e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199556
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    (cherry picked from commit 8f763a7644fc03eec6d723cb45945015c3f9832c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199561
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <[email protected]>
    (cherry picked from commit 8dd7dede5a54e36edb26c28391a1bd6f8265179f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199695
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/vcl/source/window/window3.cxx b/vcl/source/window/window3.cxx
index ce1f3ff9030c..06dacd172062 100644
--- a/vcl/source/window/window3.cxx
+++ b/vcl/source/window/window3.cxx
@@ -87,7 +87,15 @@ bool Window::GetNativeControlRegion(ControlType nType, 
ControlPart nPart,
                                                rNativeBoundingRegion, 
rNativeContentRegion);
 }
 
-Size Window::GetOutputSizePixel() const { return 
GetOutDev()->GetOutputSizePixel(); }
+Size Window::GetOutputSizePixel() const
+{
+    if (!mpWindowImpl)
+    {
+        return Size();
+    }
+
+    return GetOutDev()->GetOutputSizePixel();
+}
 
 tools::Rectangle Window::GetOutputRectPixel() const { return 
GetOutDev()->GetOutputRectPixel(); }
 

Reply via email to