diff --git a/libxrdp/xrdp_sec.c b/libxrdp/xrdp_sec.c index 6c2057aeb1..bc3551fd5d 100644 --- a/libxrdp/xrdp_sec.c +++ b/libxrdp/xrdp_sec.c @@ -2138,15 +2138,25 @@ xrdp_sec_process_mcs_data_CS_CORE(struct xrdp_sec *self, struct stream *s) { client_info->bpp = 32; } +#ifdef XRDP_RFXCODEC if (earlyCapabilityFlags & RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL) { - LOG(LOG_LEVEL_INFO, "client supports gfx protocol"); - self->rdp_layer->client_info.gfx = 1; + if (client_info->bpp < 32) + { + LOG(LOG_LEVEL_WARNING, + "client requested gfx protocol with insufficient color depth"); + } + else + { + LOG(LOG_LEVEL_INFO, "client supports gfx protocol"); + self->rdp_layer->client_info.gfx = 1; + } } else { LOG_DEVEL(LOG_LEVEL_INFO, "client DOES NOT support gfx"); } +#endif if (!s_check_rem(s, 64)) { return 0; diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index 62082022cc..6d6279f1ef 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -1484,8 +1484,7 @@ int egfx_initialize(struct xrdp_mm *self) { LOG_DEVEL(LOG_LEVEL_TRACE, "egfx_initialize"); - if (!(self->wm->client_info->mcs_early_capability_flags - & RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL)) + if (!(self->wm->client_info->gfx)) { return 0; }