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;
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
Maybe it could use MulDiv?
On Sat, Nov 16, 2019 at 12:50 AM Nikolay Sivov bunglehead@gmail.com wrote:
Maybe it could use MulDiv?
Good point, that should work. I shall send a v2 with that instead.