We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2611

Summary: Touch events cause segfault on Android
Product: SDL Reporter: Alvin <alvinbeach>
Component: videoAssignee: Gabriel Jacobo <gabomdq>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2 CC: gabomdq
Version: HG 2.0   
Hardware: Other   
OS: Android (All)   
Attachments: Passes Android_Window to the mouse-related functions rather than NULL.

Description Alvin 2014-06-27 15:39:40 UTC
Created attachment 1714 [details]
Passes Android_Window to the mouse-related functions rather than NULL.

Touch (mouse) events on Android result in a segfault.

From what I can determine, the bug was introduced in be64f5daf64b (Implemented SDL_Capture()). In src/events/SDL_mouse.c, in SDL_PrivateSendMouseMotion(), at line 251, the 'window' pointer is accessed. On Android, the 'window' argument is NULL. (see Android_OnTouch() e.g. line 89 - call to SDL_SendMouseMotion).

Attached is a patch for Android_OnTouch() that passing the 'Android_Window' global variable.

Tested on Android 4.0.4.
Comment 1 Gabriel Jacobo 2014-06-28 15:50:52 UTC
Fixed, thanks!