diff --git a/libfreerdp/codec/clear.c b/libfreerdp/codec/clear.c index fd7935bbb..ddbe19efc 100644 --- a/libfreerdp/codec/clear.c +++ b/libfreerdp/codec/clear.c @@ -102,6 +102,9 @@ int clear_decompress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize, seqNumber = pSrcData[1]; offset += 2; + if (!clear->seqNumber && seqNumber) + clear->seqNumber = seqNumber; + if (seqNumber != clear->seqNumber) return -1005; diff --git a/libfreerdp/core/rdp.c b/libfreerdp/core/rdp.c index 32f464f61..0cc9f0642 100644 --- a/libfreerdp/core/rdp.c +++ b/libfreerdp/core/rdp.c @@ -668,8 +668,10 @@ BOOL rdp_recv_monitor_layout_pdu(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < (monitorCount * 20)) return FALSE; - monitorDefArray = (MONITOR_DEF*) malloc(sizeof(MONITOR_DEF) * monitorCount); - ZeroMemory(monitorDefArray, sizeof(MONITOR_DEF) * monitorCount); + monitorDefArray = (MONITOR_DEF*) calloc(monitorCount, sizeof(MONITOR_DEF)); + + if (!monitorDefArray) + return FALSE; for (index = 0; index < monitorCount; index++) { @@ -682,6 +684,7 @@ BOOL rdp_recv_monitor_layout_pdu(rdpRdp* rdp, wStream* s) } free(monitorDefArray); + return TRUE; } diff --git a/libfreerdp/gdi/gfx.c b/libfreerdp/gdi/gfx.c index fab5caf22..f85a1e50f 100644 --- a/libfreerdp/gdi/gfx.c +++ b/libfreerdp/gdi/gfx.c @@ -29,12 +29,27 @@ int gdi_ResetGraphics(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics) { + UINT32 DesktopWidth; + UINT32 DesktopHeight; rdpGdi* gdi = (rdpGdi*) context->custom; + rdpUpdate* update = gdi->context->update; + rdpSettings* settings = gdi->context->settings; - freerdp_client_codecs_reset(gdi->codecs, FREERDP_CODEC_ALL); + DesktopWidth = resetGraphics->width; + DesktopHeight = resetGraphics->height; region16_init(&(gdi->invalidRegion)); + if ((DesktopWidth != settings->DesktopWidth) || + (DesktopHeight != settings->DesktopHeight)) + { + settings->DesktopWidth = DesktopWidth; + settings->DesktopHeight = DesktopHeight; + + if (update) + update->DesktopResize(gdi->context); + } + gdi->graphicsReset = TRUE; return 1;