Skip to content

Commit

Permalink
Fix RFX corruption.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexarian committed Jan 13, 2024
1 parent f95a8b2 commit 8519407
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions module/rdpCapture.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,12 +891,19 @@ rdpCapture2(rdpClientCon *clientCon, RegionPtr in_reg, BoxPtr *out_rects,
{
rect.x1 = x;
rect.y1 = y;
rect.x2 = rect.x1 + 64;
rect.y2 = rect.y1 + 64;
rect.x2 = rect.x1 + XRDP_RFX_ALIGN;
rect.y2 = rect.y1 + XRDP_RFX_ALIGN;
rcode = rdpRegionContainsRect(in_reg, &rect);
LLOGLN(10, ("rdpCapture2: rcode %d", rcode));

if (rcode != rgnOUT)
if (rcode == rgnOUT)
{
LLOGLN(0, ("rdpCapture2: rgnOUT"));
rdpRegionInit(&tile_reg, &rect, 0);
rdpRegionSubtract(in_reg, in_reg, &tile_reg);
rdpRegionUninit(&tile_reg);
}
else
{
crc = crc_start();
if (rcode == rgnPART)
Expand Down Expand Up @@ -933,6 +940,9 @@ rdpCapture2(rdpClientCon *clientCon, RegionPtr in_reg, BoxPtr *out_rects,
if (crc == clientCon->rfx_crcs[crc_offset])
{
LLOGLN(10, ("rdpCapture2: crc skip at x %d y %d", x, y));
rdpRegionInit(&tile_reg, &rect, 0);
rdpRegionSubtract(in_reg, in_reg, &tile_reg);
rdpRegionUninit(&tile_reg);
}
else
{
Expand All @@ -947,9 +957,9 @@ rdpCapture2(rdpClientCon *clientCon, RegionPtr in_reg, BoxPtr *out_rects,
}
}
}
x += 64;
x += XRDP_RFX_ALIGN;
}
y += 64;
y += XRDP_RFX_ALIGN;
}
*num_out_rects = out_rect_index;
return TRUE;
Expand Down

0 comments on commit 8519407

Please sign in to comment.