Limit RFX update region to screen.

This commit is contained in:
Armin Novak 2017-02-11 11:13:14 +01:00 committed by Armin Novak
parent 842a8c57ec
commit 85d8157b41
1 changed files with 11 additions and 17 deletions

View File

@ -1157,10 +1157,10 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length,
{
RECTANGLE_16 clippingRect;
const RFX_RECT* rect = &(message->rects[i]);
clippingRect.left = left + rect->x;
clippingRect.top = top + rect->y;
clippingRect.right = clippingRect.left + rect->width;
clippingRect.bottom = clippingRect.top + rect->height;
clippingRect.left = MIN(left + rect->x, dstWidth);
clippingRect.top = MIN(top + rect->y, dstHeight);
clippingRect.right = MIN(clippingRect.left + rect->width, dstWidth);
clippingRect.bottom = MIN(clippingRect.top + rect->height, dstHeight);
region16_union_rect(&clippingRects, &clippingRects, &clippingRect);
}
@ -1178,19 +1178,13 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length,
for (j = 0; j < nbUpdateRects; j++)
{
UINT32 stride = 64 * formatSize;
UINT32 nXDst = updateRects[j].left;
UINT32 nYDst = updateRects[j].top;
UINT32 nXSrc = nXDst - updateRect.left;
UINT32 nYSrc = nYDst - updateRect.top;
UINT32 nWidth = MIN(64, updateRects[j].right - updateRects[j].left);
UINT32 nHeight = MIN(64, updateRects[j].bottom - updateRects[j].top);
if (nXDst + nWidth > dstWidth)
nWidth = MAX(0, dstWidth - nXDst);
if (nYDst + nHeight > dstHeight)
nHeight = MAX(0, dstHeight - nYDst);
const UINT32 stride = 64 * formatSize;
const UINT32 nXDst = updateRects[j].left;
const UINT32 nYDst = updateRects[j].top;
const UINT32 nXSrc = nXDst - updateRect.left;
const UINT32 nYSrc = nYDst - updateRect.top;
const UINT32 nWidth = updateRects[j].right - updateRects[j].left;
const UINT32 nHeight = updateRects[j].bottom - updateRects[j].top;
if (!freerdp_image_copy(dst, dstFormat, dstStride,
nXDst, nYDst, nWidth, nHeight,