Commit 27afc0d3 authored by John Chadwick's avatar John Chadwick Committed by Alexandre Julliard

wintab32: Use 64-bit math in ScaleForContext.

With some tablet configurations, the InExt value passed to ScaleForContext can be very large, leading to an integer overflow. Signed-off-by: 's avatarJohn Chadwick <john@jchw.io> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent a45dfea9
......@@ -178,9 +178,9 @@ int TABLET_PostTabletMessage(LPOPENCONTEXT newcontext, UINT msg, WPARAM wParam,
static inline DWORD ScaleForContext(DWORD In, LONG InOrg, LONG InExt, LONG OutOrg, LONG OutExt)
{
if (((InExt > 0 )&&(OutExt > 0)) || ((InExt<0) && (OutExt < 0)))
return ((In - InOrg) * abs(OutExt) / abs(InExt)) + OutOrg;
return MulDiv(In - InOrg, abs(OutExt), abs(InExt)) + OutOrg;
else
return ((abs(InExt) - (In - InOrg))*abs(OutExt) / abs(InExt)) + OutOrg;
return MulDiv(abs(InExt) - (In - InOrg), abs(OutExt), abs(InExt)) + OutOrg;
}
LPOPENCONTEXT AddPacketToContextQueue(LPWTPACKET packet, HWND hwnd)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment