From 7e9c3569f9258877b5303f041283d4882d1290fe Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Tue, 1 Jun 2021 19:08:13 +0200 Subject: tdf#92917: fix crash in Impress in viewmediashape (slideshow) See bt here: https://bugs.documentfoundation.org/attachment.cgi?id=172527 I thought about this patch comparing with OGLTransitionerImpl::initWindowFromSlideShowView in: slideshow/source/engine/opengl/TransitionerImpl.cxx 304 /// take the XSlideShowView and extract the parent window from it. see viewmediashape.cxx 305 uno::Reference< rendering::XCanvas > xCanvas(mxView->getCanvas(), uno::UNO_QUERY_THROW); 306 uno::Sequence< uno::Any > aDeviceParams; 307 ::canvas::tools::getDeviceInfo( xCanvas, aDeviceParams ); ... 317 OutputDevice* pDevice = reinterpret_cast(aVal); 318 vcl::Window* pWindow = pDevice ? pDevice->GetOwnerWindow() : nullptr; Change-Id: I183cc8271f75fb145c27688c5594805792c1fdaf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116551 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Julien Nabet --- slideshow/source/engine/shapes/viewmediashape.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx index cddaea4c1b0b..2179f71ba78c 100644 --- a/slideshow/source/engine/shapes/viewmediashape.cxx +++ b/slideshow/source/engine/shapes/viewmediashape.cxx @@ -393,7 +393,8 @@ namespace slideshow::internal rVCLDeviceParams[ 1 ] >>= aVal; - vcl::Window* pWindow = reinterpret_cast< vcl::Window* >( aVal ); + OutputDevice* pDevice = reinterpret_cast(aVal); + vcl::Window* pWindow = pDevice ? pDevice->GetOwnerWindow() : nullptr; if( pWindow ) { -- cgit