libfreerdp-codec: fix xcrush context flush

This commit is contained in:
Marc-André Moreau 2016-05-11 16:35:20 -04:00
parent 6b73757085
commit a0630dee07
1 changed files with 15 additions and 8 deletions

View File

@ -816,19 +816,26 @@ int xcrush_decompress(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 SrcSize, BY
pSrcData += 2;
SrcSize -= 2;
if (Level2ComprFlags & PACKET_COMPRESSED)
{
status = mppc_decompress(xcrush->mppc, pSrcData, SrcSize, &pDstData, &DstSize, Level2ComprFlags);
if (status < 0)
return status;
}
else
if (!(Level2ComprFlags & PACKET_COMPRESSED))
{
pDstData = pSrcData;
DstSize = SrcSize;
status = xcrush_decompress_l1(xcrush, pDstData, DstSize, ppDstData, pDstSize, Level1ComprFlags);
return status;
}
if (Level2ComprFlags & PACKET_FLUSHED)
{
xcrush_context_reset(xcrush, FALSE);
}
status = mppc_decompress(xcrush->mppc, pSrcData, SrcSize, &pDstData, &DstSize, Level2ComprFlags);
if (status < 0)
return status;
status = xcrush_decompress_l1(xcrush, pDstData, DstSize, ppDstData, pDstSize, Level1ComprFlags);
return status;