efl_ui_stack: Fix dereference null return value

Coverity reports that efl_data_scope_safe_get returns NULL here (273
out of 281 times). _end_anim dereferences pd directly, so we should
check for a valid 'pd' before calling _end_anim function.

Fixes Coverity CID1399082

@fix

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8315
This commit is contained in:
Christopher Michael 2019-03-12 10:22:26 -04:00 committed by Marcel Hollerbach
parent 5473141072
commit 8ef176ca53
1 changed files with 4 additions and 0 deletions

View File

@ -124,6 +124,8 @@ _hide_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
Efl_Ui_Stack_Data *pd = efl_data_scope_safe_get(data, EFL_UI_STACK_CLASS);
Efl_Canvas_Object *content;
EINA_SAFETY_ON_NULL_RETURN(pd);
content = _end_anim(pd->hide_td);
pd->hide_td = NULL;
efl_gfx_entity_visible_set(content, EINA_FALSE);
@ -136,6 +138,8 @@ _show_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
Efl_Ui_Stack_Data *pd = efl_data_scope_safe_get(data, EFL_UI_STACK_CLASS);
Efl_Canvas_Object *content;
EINA_SAFETY_ON_NULL_RETURN(pd);
content = _end_anim(pd->show_td);
pd->show_td = NULL;
//Activated Event