From 6e59d9597cdbd76b5522306d86185f64d06bfc00 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 18 May 2020 09:30:59 +0200 Subject: [PATCH] Fixed history buffer reset. --- libfreerdp/codec/mppc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libfreerdp/codec/mppc.c b/libfreerdp/codec/mppc.c index cdad24863..217fae41d 100644 --- a/libfreerdp/codec/mppc.c +++ b/libfreerdp/codec/mppc.c @@ -772,11 +772,15 @@ void mppc_context_reset(MPPC_CONTEXT* mppc, BOOL flush) ZeroMemory(&(mppc->MatchBuffer), sizeof(mppc->MatchBuffer)); if (flush) + { mppc->HistoryOffset = mppc->HistoryBufferSize + 1; + mppc->HistoryPtr = mppc->HistoryBuffer; + } else + { mppc->HistoryOffset = 0; - mppc->HistoryPtr = &(mppc->HistoryBuffer[mppc->HistoryOffset]); + } } MPPC_CONTEXT* mppc_context_new(DWORD CompressionLevel, BOOL Compressor)