mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 08:54:38 +09:00
server/shadow: Fix incorrect bitmap fragment update.
Legacy bitmap update might fail with 'fast path update size (xxxxx) exceeds the client's maximum request size (xxxxx)' Original code might update last fragment with exceeded fragment size incorrectly. Fix the logic to prevent it.
This commit is contained in:
@@ -1095,19 +1095,14 @@ static BOOL shadow_client_send_bitmap_update(rdpShadowClient* client,
|
||||
{
|
||||
newUpdateSize = updateSize + (bitmapData[i].bitmapLength + 16);
|
||||
|
||||
if ((newUpdateSize < maxUpdateSize) && ((i + 1) < k))
|
||||
if (newUpdateSize < maxUpdateSize)
|
||||
{
|
||||
CopyMemory(&fragBitmapData[j++], &bitmapData[i++], sizeof(BITMAP_DATA));
|
||||
updateSize = newUpdateSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((i + 1) >= k)
|
||||
{
|
||||
CopyMemory(&fragBitmapData[j++], &bitmapData[i++], sizeof(BITMAP_DATA));
|
||||
updateSize = newUpdateSize;
|
||||
}
|
||||
|
||||
if ((newUpdateSize >= maxUpdateSize) || (i + 1) >= k)
|
||||
{
|
||||
bitmapUpdate.count = bitmapUpdate.number = j;
|
||||
IFCALLRET(update->BitmapUpdate, ret, context, &bitmapUpdate);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user