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 ) {