From 86327cba6fd447781cfb941c62621bbb8c75fe9e Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 19 Feb 2026 08:49:18 +0100 Subject: [PATCH] [server,shadow] fix return and parameter checks --- server/shadow/shadow_client.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index 66fb216b2..f9b13ee16 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -1170,8 +1170,11 @@ static BOOL shadow_client_send_surface_gfx(rdpShadowClient* client, const BYTE* if (client->first_frame) { - if (!rfx_context_reset(encoder->rfx, nWidth, nHeight)) - return FALSE; + if (encoder->rfx) + { + if (!rfx_context_reset(encoder->rfx, nWidth, nHeight)) + return FALSE; + } client->first_frame = FALSE; } @@ -2501,7 +2504,8 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg) { if (WaitForSingleObject(gfxevent, 0) == WAIT_OBJECT_0) { - if (!rdpgfx_server_handle_messages(client->rdpgfx)) + const UINT error = rdpgfx_server_handle_messages(client->rdpgfx); + if (error != CHANNEL_RC_OK) goto fail; } }