Merge pull request #4255 from akallabeth/rfx_fix

Fix #4253: Rfx decode tile width.
This commit is contained in:
David Fort 2017-11-23 15:35:52 +01:00 committed by GitHub
commit d982cf0e90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View File

@ -994,6 +994,7 @@ static BOOL xf_gdi_update_screen(xfContext* xfc, const BYTE* pSrcData,
XImage* image;
UINT32 i, nbRects;
const RECTANGLE_16* rects;
UINT32 bpp;
if (!xfc || !pSrcData)
return FALSE;
@ -1001,6 +1002,12 @@ static BOOL xf_gdi_update_screen(xfContext* xfc, const BYTE* pSrcData,
if (!(rects = region16_rects(pRegion, &nbRects)))
return TRUE;
if (xfc->depth > 16)
bpp = 4;
else if (xfc->depth > 8)
bpp = 2;
else
bpp = 1;
XSetFunction(xfc->display, xfc->gc, GXcopy);
XSetFillStyle(xfc->display, xfc->gc, FillSolid);
@ -1010,15 +1017,16 @@ static BOOL xf_gdi_update_screen(xfContext* xfc, const BYTE* pSrcData,
UINT32 top = rects[i].top;
UINT32 width = rects[i].right - rects[i].left;
UINT32 height = rects[i].bottom - rects[i].top;
const BYTE* src = pSrcData + top * scanline + 4 * left;
const BYTE* src = pSrcData + top * scanline + bpp * left;
image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0,
(char*) src, width, height, xfc->scanline_pad, scanline);
if (!image)
break;
image->byte_order = LSBFirst;
image->bitmap_bit_order = LSBFirst;
XPutImage(xfc->display, xfc->primary, xfc->gc, image, 0, 0, left, top, width, height);
XFree(image);
ret = xf_gdi_surface_update_frame(xfc, left, top, width, height);
@ -1047,7 +1055,10 @@ static BOOL xf_gdi_surface_bits(rdpContext* context,
cmdRect.top = cmd->destTop;
cmdRect.right = cmdRect.left + cmd->width;
cmdRect.bottom = cmdRect.top + cmd->height;
gdi = context->gdi;
xf_lock_x11(xfc, FALSE);
switch (cmd->codecID)

View File

@ -1150,7 +1150,7 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length,
REGION16 clippingRects;
const RECTANGLE_16* updateRects;
const DWORD formatSize = GetBytesPerPixel(context->pixel_format);
const UINT32 dstWidth = dstStride / formatSize;
const UINT32 dstWidth = dstStride / GetBytesPerPixel(dstFormat);
region16_init(&clippingRects);
for (i = 0; i < message->numRects; i++)