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 2430 - Missing initialization of the variable 'centroid' inside SDL_GestureAddTouch
Summary: Missing initialization of the variable 'centroid' inside SDL_GestureAddTouch
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 2.0.1
Hardware: x86_64 Windows 7
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-06 08:49 UTC by klose
Modified: 2014-03-07 04:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description klose 2014-03-06 08:49:52 UTC
File: SDL_gesture.c
Method: SDL_GestureAddTouch

When a new SDL_GestureTouch element is added to the global SDL_gestureTouch array the variable 'centroid' of the new element is not initialized.

The problem is that this variable is read isndie SDL_GestureProcessEvent when a SDL_FINGERDOWN event occurs.

Fixed it by adding the following line to the SDL_GestureAddTouch method at the line 422: SDL_memset(gestureTouch, 0, sizeof(SDL_GestureTouch));
Comment 1 Sam Lantinga 2014-03-07 04:06:58 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/cb13016bf07b