[PATCH] 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. Using 64-bit integers is a simple way to ensure that there is no overflow without making the code more complicated. --- dlls/wintab32/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wintab32/context.c b/dlls/wintab32/context.c index 0514dd78b4..9050a12df5 100644 --- a/dlls/wintab32/context.c +++ b/dlls/wintab32/context.c @@ -175,7 +175,7 @@ int TABLET_PostTabletMessage(LPOPENCONTEXT newcontext, UINT msg, WPARAM wParam, return 0; } -static inline DWORD ScaleForContext(DWORD In, LONG InOrg, LONG InExt, LONG OutOrg, LONG OutExt) +static inline DWORD ScaleForContext(ULONGLONG In, LONGLONG InOrg, LONGLONG InExt, LONGLONG OutOrg, LONGLONG OutExt) { if (((InExt > 0 )&&(OutExt > 0)) || ((InExt<0) && (OutExt < 0))) return ((In - InOrg) * abs(OutExt) / abs(InExt)) + OutOrg; -- 2.23.0
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=60284 Your paranoid android. === debian10 (build log) === error: corrupt patch at line 14 Task: Patch failed to apply === debian10 (build log) === error: corrupt patch at line 14 Task: Patch failed to apply
participants (3)
-
John Chadwick -
Marvin -
Nikolay Sivov