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 - Touch events cause segfault on Android
Summary: Touch events cause segfault on Android
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: Other Android (All)
: P2 blocker
Assignee: Gabriel Jacobo
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-27 15:39 UTC by Alvin
Modified: 2014-06-28 15:50 UTC (History)
1 user (show)

See Also:


Attachments
Passes Android_Window to the mouse-related functions rather than NULL. (1.75 KB, patch)
2014-06-27 15:39 UTC, Alvin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!