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;