Ver Fonte

avoid UB (left shift of negative number) in SDL_windowsevents.c

(cherry picked from commit f1d16e9b4dcc8bfac5fe13b22b16d6552b1fcf79)
rohlem há 1 mês atrás
pai
commit
74b3b8e9e3
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      src/video/windows/SDL_windowsevents.c

+ 1 - 1
src/video/windows/SDL_windowsevents.c

@@ -1640,7 +1640,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
             POINT cursorPos;
             GetCursorPos(&cursorPos);
             ScreenToClient(hwnd, &cursorPos);
-            PostMessage(hwnd, WM_MOUSEMOVE, 0, cursorPos.x | cursorPos.y << 16);
+            PostMessage(hwnd, WM_MOUSEMOVE, 0, cursorPos.x | (((unsigned int)((short)cursorPos.y)) << 16));
         }
     } break;