From e65e9c803206ba21300dddedc30f0b1b5494e94b Mon Sep 17 00:00:00 2001 From: Corentin SORIANO Date: Thu, 29 May 2025 21:36:08 +0200 Subject: [PATCH] GUACAMOLE-2078: Fix assertion failure when screen is resized during a paint operation. Since FreeRDP 3.8.0, EndPaind is always called by `gdi_resize()`, so this assertion is no longer relevant. --- src/protocols/rdp/gdi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/protocols/rdp/gdi.c b/src/protocols/rdp/gdi.c index 5a98cf68..68fe36e7 100644 --- a/src/protocols/rdp/gdi.c +++ b/src/protocols/rdp/gdi.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -159,7 +160,14 @@ BOOL guac_rdp_gdi_desktop_resize(rdpContext* context) { int width = guac_rdp_get_width(context->instance); int height = guac_rdp_get_height(context->instance); +#if (FREERDP_VERSION_MAJOR < 3) || \ + (FREERDP_VERSION_MAJOR == 3 && FREERDP_VERSION_MINOR < 8) + /* For FreeRDP versions prior to 3.8.0, EndPaint will not be called in + * `gdi_resize()`, so the current context should be NULL. If it is not + * NULL, it means that the current context is still open, and therefore the + * GDI buffer has not been flushed yet. */ GUAC_ASSERT(rdp_client->current_context == NULL); +#endif /* All potential drawing operations must occur while holding an open context */ guac_display_layer* default_layer = guac_display_default_layer(rdp_client->display);