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

Summary: Missing initialization of the variable 'centroid' inside SDL_GestureAddTouch
Product: SDL Reporter: klose
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.1   
Hardware: x86_64   
OS: Windows 7   

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