summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-11-21 18:41:08 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-11-21 18:41:08 +0100
commit17ba8515f1c9534ebd47a71adda71db2eff6799a (patch)
tree084a758426581e867f14c654e693046c1123a733
parenteeff991076aa39f336557c72b4914576dcb76449 (diff)
efl_canvas_object_animation: fix possible invalid pointerHEADmaster
now if one of the event handlers calls animation_stop in a callback to EFL_CANVAS_OBJECT_ANIMATION_EVENT_ANIMATION_PROGRESS_UPDATED, then pd->in will be freeed. Which means, in the next event handler the address taken by &pd->in->progress might be invalid, leading to a crash. With this commit this is a address on the stack, which should fix this.
-rw-r--r--src/lib/evas/canvas/efl_canvas_object_animation.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_object_animation.c b/src/lib/evas/canvas/efl_canvas_object_animation.c
index 9028677..5663833 100644
--- a/src/lib/evas/canvas/efl_canvas_object_animation.c
+++ b/src/lib/evas/canvas/efl_canvas_object_animation.c
@@ -59,7 +59,8 @@ _animator_cb(void *data, const Efl_Event *ev EINA_UNUSED)
59 efl_gfx_mapping_reset(obj); 59 efl_gfx_mapping_reset(obj);
60 efl_animation_apply(pd->in->animation, pd->in->progress, obj); 60 efl_animation_apply(pd->in->animation, pd->in->progress, obj);
61 61
62 efl_event_callback_call(obj, EFL_CANVAS_OBJECT_ANIMATION_EVENT_ANIMATION_PROGRESS_UPDATED, &pd->in->progress); 62 double progress = pd->in->progress;
63 efl_event_callback_call(obj, EFL_CANVAS_OBJECT_ANIMATION_EVENT_ANIMATION_PROGRESS_UPDATED, &progress);
63 64
64 //Check if animation stopped in animation_progress,updated callback. 65 //Check if animation stopped in animation_progress,updated callback.
65 if (!pd->in) return; 66 if (!pd->in) return;