From ce8fc4e0f41efc55cf26e82fafce6f23e1dac2af Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 15 Apr 2025 10:13:52 +0200 Subject: [PATCH] [client,sdl] only draw to window if connected --- client/SDL/SDL3/sdl_freerdp.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/SDL/SDL3/sdl_freerdp.cpp b/client/SDL/SDL3/sdl_freerdp.cpp index 554529880..96251e032 100644 --- a/client/SDL/SDL3/sdl_freerdp.cpp +++ b/client/SDL/SDL3/sdl_freerdp.cpp @@ -295,6 +295,7 @@ static BOOL sdl_begin_paint(rdpContext* context) static bool sdl_draw_to_window_rect([[maybe_unused]] SdlContext* sdl, SdlWindow& window, SDL_Surface* surface, SDL_Point offset, const SDL_Rect& srcRect) { + WINPR_ASSERT(surface); SDL_Rect dstRect = { offset.x + srcRect.x, offset.y + srcRect.y, srcRect.w, srcRect.h }; return window.blit(surface, srcRect, dstRect); } @@ -345,8 +346,12 @@ static BOOL sdl_draw_to_window(SdlContext* sdl, SdlWindow& window, { WINPR_ASSERT(sdl); + if (!sdl->isConnected()) + return TRUE; + auto context = sdl->context(); auto gdi = context->gdi; + WINPR_ASSERT(gdi); auto size = window.rect();