Skip to content

Commit

Permalink
Fixed bug 3701 - WM_TOUCH message may cause calls to null if touch fu…
Browse files Browse the repository at this point in the history
…nctions are not properly loaded

Simon Hug

When WIN_WindowProc processes the WM_TOUCH message, it doesn't check if the touch functions have been properly loaded and may call a NULL pointer. It's probably an extremely rare case, but here's a patch that adds some checks anyway.
  • Loading branch information
slouken committed Aug 10, 2017
1 parent a47bf37 commit 843293b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/video/windows/SDL_windowsevents.c
Expand Up @@ -884,7 +884,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
break;

case WM_TOUCH:
{
if (data->videodata->GetTouchInputInfo && data->videodata->CloseTouchInputHandle) {
UINT i, num_inputs = LOWORD(wParam);
PTOUCHINPUT inputs = SDL_stack_alloc(TOUCHINPUT, num_inputs);
if (data->videodata->GetTouchInputInfo((HTOUCHINPUT)lParam, num_inputs, inputs, sizeof(TOUCHINPUT))) {
Expand Down

0 comments on commit 843293b

Please sign in to comment.