[client] core: fix use of unintalized variable

util_guestCurToLocal may not be able to provide the local position if
we do not yet know where the guest cursor is, or the destination render
rect dimensions. Acting on this when this information is unknown causes
undefined behaivour.
This commit is contained in:
Geoffrey McRae 2021-05-28 17:00:13 +10:00
parent 2e239ede3f
commit 09a7e177fa

View File

@ -319,7 +319,9 @@ void core_stopFrameThread(void)
void core_handleGuestMouseUpdate(void)
{
struct DoublePoint localPos;
util_guestCurToLocal(&localPos);
if (!util_guestCurToLocal(&localPos))
return;
g_state.ds->guestPointerUpdated(
g_cursor.guest.x, g_cursor.guest.y,
util_clamp(localPos.x, g_state.dstRect.x,