Skip to content

Commit

Permalink
fix crash when odd monitor height
Browse files Browse the repository at this point in the history
(cherry picked from commit 7857c1e)
  • Loading branch information
jsorg71 authored and metalefty committed Aug 4, 2024
1 parent 20d0c54 commit a12f232
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions module/rdpCapture.c
Original file line number Diff line number Diff line change
Expand Up @@ -1281,13 +1281,21 @@ rdpCaptureGfxA2(rdpClientCon *clientCon, RegionPtr in_reg, BoxPtr *out_rects,
while (index < num_rects)
{
rect = psrc_rects[index];
LLOGLN(10, ("old x1 %d y1 %d x2 %d y2 %d", rect.x1, rect.x2,
LLOGLN(10, ("old x1 %d y1 %d x2 %d y2 %d", rect.x1, rect.y1,
rect.x2, rect.y2));
rect.x1 -= rect.x1 & 1;
rect.y1 -= rect.y1 & 1;
rect.x2 += rect.x2 & 1;
rect.y2 += rect.y2 & 1;
LLOGLN(10, ("new x1 %d y1 %d x2 %d y2 %d", rect.x1, rect.x2,
if (rect.x2 > id->width)
{
rect.x2 = id->width & ~1;
}
if (rect.y2 > id->height)
{
rect.y2 = id->height & ~1;
}
LLOGLN(10, ("new x1 %d y1 %d x2 %d y2 %d", rect.x1, rect.y1,
rect.x2, rect.y2));
(*out_rects)[index] = rect;
index++;
Expand Down

0 comments on commit a12f232

Please sign in to comment.