From b6bd7ecdf06f04bf1316095f47f473bc30929607 Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Mon, 15 Oct 2018 11:43:20 +0300 Subject: [PATCH] Player: fix crash when no action is present in the file It can happen if the file doesn't contain any actions or if no shot is present. In this last case, an optimization in the player removes the actions after the last shot, meaning it will remove all the actions if no shot is present. An example is window_states_2 test where the shots cannot be taken by the recorder, as F2 is not caught. --- src/bin/player.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/player.c b/src/bin/player.c index afbd13f..c1fc6ed 100644 --- a/src/bin/player.c +++ b/src/bin/player.c @@ -538,7 +538,7 @@ static Eina_Bool _feed_event_timer_cb(void *data EINA_UNUSED) { Exactness_Action *act = eina_list_data_get(_cur_event_list); - _feed_event(act->type, act->n_evas, act->data); + if (act) _feed_event(act->type, act->n_evas, act->data); _cur_event_list = eina_list_next(_cur_event_list); if (!_cur_event_list) @@ -780,7 +780,7 @@ _src_feed(void *data EINA_UNUSED) _cur_event_list = _src_unit->actions; Exactness_Action *act = eina_list_data_get(_cur_event_list); - if (act->delay_ms) + if (act && act->delay_ms) { _printf(2, " Waiting <%f>\n", act->delay_ms / 1000.0); ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL);