From e9eb7ecd08ac3b8ce2edc7f78d36f77f7117fd7d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 6 Mar 2014 20:02:17 -0800 Subject: [PATCH] Fixed bug 2430 - Missing initialization of the variable 'centroid' inside SDL_GestureAddTouch klose 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. --- src/events/SDL_gesture.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c index a6ef5b5dd..a47ab7d13 100644 --- a/src/events/SDL_gesture.c +++ b/src/events/SDL_gesture.c @@ -418,13 +418,8 @@ int SDL_GestureAddTouch(SDL_TouchID touchId) SDL_gestureTouch = gestureTouch; - SDL_gestureTouch[SDL_numGestureTouches].numDownFingers = 0; + SDL_zero(SDL_gestureTouch[SDL_numGestureTouches]); SDL_gestureTouch[SDL_numGestureTouches].id = touchId; - - SDL_gestureTouch[SDL_numGestureTouches].numDollarTemplates = 0; - - SDL_gestureTouch[SDL_numGestureTouches].recording = SDL_FALSE; - SDL_numGestureTouches++; return 0; }