From e114c90bdadda4c2e49246411e4157025e5f0cca Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 15 Oct 2013 18:23:46 +0100 Subject: gesture-action: fix memory corruption abcf1d589f29ba7914d5648bb9814ad26c13cd83 introduced a crasher because the 'point' variable points to a piece of memory that is being reallocated by the begin_gesture (by a g_array_set_size) call 5 lines before. https://bugzilla.gnome.org/show_bug.cgi?id=710227 (cherry picked from commit 97724939c8de004d7fa230f3ff64862d957f93a9) Signed-off-by: Emmanuele Bassi --- clutter/clutter-gesture-action.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-gesture-action.c b/clutter/clutter-gesture-action.c index 6a116d0b7..09324f48d 100644 --- a/clutter/clutter-gesture-action.c +++ b/clutter/clutter-gesture-action.c @@ -396,11 +396,15 @@ stage_captured_event_cb (ClutterActor *stage, return CLUTTER_EVENT_PROPAGATE; } - if (!begin_gesture(action, actor)) + if (!begin_gesture (action, actor)) { - gesture_update_motion_point (point, event); + if ((point = gesture_find_point (action, event, &position)) != NULL) + gesture_update_motion_point (point, event); return CLUTTER_EVENT_PROPAGATE; } + + if ((point = gesture_find_point (action, event, &position)) == NULL) + return CLUTTER_EVENT_PROPAGATE; } gesture_update_motion_point (point, event); -- cgit v1.2.1