mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[warnings] fix initialization skip warnings
This commit is contained in:
@@ -479,17 +479,19 @@ static UINT ainput_process_message(ainput_server* ainput)
|
||||
}
|
||||
|
||||
Stream_SetLength(s, ActualBytesReturned);
|
||||
const UINT16 MessageId = Stream_Get_UINT16(s);
|
||||
|
||||
switch (MessageId)
|
||||
{
|
||||
case MSG_AINPUT_MOUSE:
|
||||
error = ainput_server_recv_mouse_event(ainput, s);
|
||||
break;
|
||||
const UINT16 MessageId = Stream_Get_UINT16(s);
|
||||
|
||||
default:
|
||||
WLog_ERR(TAG, "audin_server_thread_func: unknown MessageId %" PRIu16 "", MessageId);
|
||||
break;
|
||||
switch (MessageId)
|
||||
{
|
||||
case MSG_AINPUT_MOUSE:
|
||||
error = ainput_server_recv_mouse_event(ainput, s);
|
||||
break;
|
||||
|
||||
default:
|
||||
WLog_ERR(TAG, "audin_server_thread_func: unknown MessageId %" PRIu16 "", MessageId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
@@ -303,12 +303,14 @@ static BOOL xf_Pointer_New(rdpContext* context, rdpPointer* pointer)
|
||||
xpointer->nCursors = 0;
|
||||
xpointer->mCursors = 0;
|
||||
|
||||
const size_t size =
|
||||
1ull * pointer->height * pointer->width * FreeRDPGetBytesPerPixel(CursorFormat);
|
||||
{
|
||||
const size_t size =
|
||||
1ull * pointer->height * pointer->width * FreeRDPGetBytesPerPixel(CursorFormat);
|
||||
|
||||
xpointer->cursorPixels = (XcursorPixel*)winpr_aligned_malloc(size, 16);
|
||||
if (!xpointer->cursorPixels)
|
||||
goto fail;
|
||||
xpointer->cursorPixels = (XcursorPixel*)winpr_aligned_malloc(size, 16);
|
||||
if (!xpointer->cursorPixels)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!freerdp_image_copy_from_pointer_data(
|
||||
(BYTE*)xpointer->cursorPixels, CursorFormat, 0, 0, 0, pointer->width, pointer->height,
|
||||
|
||||
@@ -1360,33 +1360,36 @@ static UINT gdi_SurfaceToSurface(RdpgfxClientContext* context,
|
||||
if (!is_rect_valid(rectSrc, surfaceSrc->width, surfaceSrc->height))
|
||||
goto fail;
|
||||
|
||||
const UINT32 nWidth = rectSrc->right - rectSrc->left;
|
||||
const UINT32 nHeight = rectSrc->bottom - rectSrc->top;
|
||||
|
||||
for (UINT16 index = 0; index < surfaceToSurface->destPtsCount; index++)
|
||||
{
|
||||
const RDPGFX_POINT16* destPt = &surfaceToSurface->destPts[index];
|
||||
const RECTANGLE_16 rect = { destPt->x, destPt->y,
|
||||
(UINT16)MIN(UINT16_MAX, destPt->x + nWidth),
|
||||
(UINT16)MIN(UINT16_MAX, destPt->y + nHeight) };
|
||||
if (!is_rect_valid(&rect, surfaceDst->width, surfaceDst->height))
|
||||
goto fail;
|
||||
const UINT32 nWidth = rectSrc->right - rectSrc->left;
|
||||
const UINT32 nHeight = rectSrc->bottom - rectSrc->top;
|
||||
|
||||
const UINT32 rwidth = rect.right - rect.left;
|
||||
const UINT32 rheight = rect.bottom - rect.top;
|
||||
if (!freerdp_image_copy(surfaceDst->data, surfaceDst->format, surfaceDst->scanline,
|
||||
destPt->x, destPt->y, rwidth, rheight, surfaceSrc->data,
|
||||
surfaceSrc->format, surfaceSrc->scanline, rectSrc->left,
|
||||
rectSrc->top, NULL, FREERDP_FLIP_NONE))
|
||||
goto fail;
|
||||
for (UINT16 index = 0; index < surfaceToSurface->destPtsCount; index++)
|
||||
{
|
||||
const RDPGFX_POINT16* destPt = &surfaceToSurface->destPts[index];
|
||||
const RECTANGLE_16 rect = { destPt->x, destPt->y,
|
||||
(UINT16)MIN(UINT16_MAX, destPt->x + nWidth),
|
||||
(UINT16)MIN(UINT16_MAX, destPt->y + nHeight) };
|
||||
if (!is_rect_valid(&rect, surfaceDst->width, surfaceDst->height))
|
||||
goto fail;
|
||||
|
||||
invalidRect = rect;
|
||||
region16_union_rect(&surfaceDst->invalidRegion, &surfaceDst->invalidRegion, &invalidRect);
|
||||
status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context,
|
||||
surfaceDst->surfaceId, 1, &invalidRect);
|
||||
const UINT32 rwidth = rect.right - rect.left;
|
||||
const UINT32 rheight = rect.bottom - rect.top;
|
||||
if (!freerdp_image_copy(surfaceDst->data, surfaceDst->format, surfaceDst->scanline,
|
||||
destPt->x, destPt->y, rwidth, rheight, surfaceSrc->data,
|
||||
surfaceSrc->format, surfaceSrc->scanline, rectSrc->left,
|
||||
rectSrc->top, NULL, FREERDP_FLIP_NONE))
|
||||
goto fail;
|
||||
|
||||
if (status != CHANNEL_RC_OK)
|
||||
goto fail;
|
||||
invalidRect = rect;
|
||||
region16_union_rect(&surfaceDst->invalidRegion, &surfaceDst->invalidRegion,
|
||||
&invalidRect);
|
||||
status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context,
|
||||
surfaceDst->surfaceId, 1, &invalidRect);
|
||||
|
||||
if (status != CHANNEL_RC_OK)
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&context->mux);
|
||||
|
||||
Reference in New Issue
Block a user