rdp: fix zgfx compression

In the case of raw tokens the decompressor was bogus and was either not updating
the output count, or not updating the number of consumed bits.
This commit is contained in:
David Fort 2023-02-10 08:20:59 +01:00 committed by Alexis La Goutte
parent 4221021ab6
commit 407ebfbf94
1 changed files with 3 additions and 0 deletions

View File

@ -90,6 +90,7 @@ bitstream_copyraw_advance(bitstream_t *b, guint8 *dest, guint nbytes)
return FALSE;
b->offset += nbytes;
b->remainingBits -= (nbytes * 8);
return TRUE;
}
@ -256,6 +257,8 @@ zgfx_write_raw(zgfx_context_t *zgfx, bitstream_t *b, guint32 count)
if (!bitstream_copyraw(b, &(zgfx->outputSegment[zgfx->outputCount]), count))
return FALSE;
zgfx->outputCount += count;
/* then update the history buffer */
rest = (zgfx->historyBufferSize - zgfx->historyIndex);
tocopy = count;