From 965dbdedb7b2b80b9fcaa391ef445641824513dc Mon Sep 17 00:00:00 2001 From: Christopher Pitstick Date: Sat, 25 Jun 2022 22:37:11 -0400 Subject: [PATCH] Fixes MSTSC resize issue/crash The RFX compression mode requires an encoder. When you resize RFX, you have to recreate the encoder. This will fix it as well: https://github.com/neutrinolabs/xrdp/pull/2175, however, that PR is bigger and more complex and may take longer. --- xrdp/xrdp_mm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index 22993d01..9ee7b8e8 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -1130,6 +1130,17 @@ process_dynamic_monitor_description(struct xrdp_wm *wm, } } + // Need to recreate the encoder for connections that use it. + if (mm->encoder != NULL) + { + xrdp_encoder_delete(mm->encoder); + mm->encoder = NULL; + } + if (mm->encoder == NULL) + { + mm->encoder = xrdp_encoder_create(mm); + } + wm->client_info->display_sizes.monitorCount = description->monitorCount; wm->client_info->display_sizes.session_width = description->session_width; wm->client_info->display_sizes.session_height = description->session_height;