Fixed rfx_process_message use

This commit is contained in:
akallabeth 2022-05-31 11:48:30 +02:00 committed by akallabeth
parent 1cc06dc3a5
commit 5460bb3133
1 changed files with 2 additions and 25 deletions

View File

@ -154,9 +154,6 @@ static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap, const
{ {
if ((codecId == RDP_CODEC_ID_REMOTEFX) || (codecId == RDP_CODEC_ID_IMAGE_REMOTEFX)) if ((codecId == RDP_CODEC_ID_REMOTEFX) || (codecId == RDP_CODEC_ID_IMAGE_REMOTEFX))
{ {
RFX_TILE* tile;
RFX_RECT* rect;
RFX_MESSAGE* message;
REGION16 invalidRegion; REGION16 invalidRegion;
region16_init(&invalidRegion); region16_init(&invalidRegion);
@ -164,34 +161,14 @@ static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap, const
gdi->height)) gdi->height))
return FALSE; return FALSE;
message = rfx_process_message(context->codecs->rfx, pSrcData, SrcSize, bitmap->left, if (!rfx_process_message(context->codecs->rfx, pSrcData, SrcSize, bitmap->left,
bitmap->top, bitmap->data, bitmap->format, gdi->stride, gdi->height, bitmap->top, bitmap->data, bitmap->format, gdi->stride, gdi->height,
&invalidRegion); &invalidRegion))
if (!message)
{ {
WLog_ERR(TAG, "rfx_process_message failure"); WLog_ERR(TAG, "rfx_process_message failure");
return FALSE; return FALSE;
} }
if ((message->numTiles == 1) && (message->numRects == 1) && (DstWidth <= 64) &&
(DstHeight <= 64))
{
tile = message->tiles[0];
rect = &message->rects[0];
freerdp_image_copy(bitmap->data,PIXEL_FORMAT_XRGB32, DstWidth * 4, 0, 0, DstWidth,
DstHeight, tile->data, PIXEL_FORMAT_XRGB32, 64 * 4, 0, 0, NULL,
FREERDP_FLIP_VERTICAL);
}
else
{
WLog_WARN(TAG, "RfxMessage: numTiles: %d numRects: %d width: %d height: %d",
message->numTiles, message->numRects, DstWidth, DstHeight);
}
rfx_message_free(context->codecs->rfx, message);
status = 1; status = 1;
} }
else if (codecId == RDP_CODEC_ID_NSCODEC) else if (codecId == RDP_CODEC_ID_NSCODEC)