summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBowon Ryu <bowon.ryu@samsung.com>2018-06-25 06:55:57 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-06-25 06:55:57 -0400
commitddeae9642128a281cf8f531b8403669355e36a99 (patch)
treed6e3064cabe2ffc5caefa48703aa70555cdedd04
parent4378d6feb9b62b11870d76c918fcbb7a95197fee (diff)
elm_slider: add null check to avoid seg fault.
Summary: a segmentation fault occurs once the argument is not valid. Test Plan: N/A Reviewers: eagleeye, devilhorns, zmike Reviewed By: eagleeye, zmike Subscribers: #committers, cedric, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6362
-rw-r--r--src/lib/elementary/elm_slider.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c
index b0d53292d2..7b36da532e 100644
--- a/src/lib/elementary/elm_slider.c
+++ b/src/lib/elementary/elm_slider.c
@@ -1236,7 +1236,7 @@ EAPI void
1236elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) 1236elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
1237{ 1237{
1238 Efl_Ui_Dir dir; 1238 Efl_Ui_Dir dir;
1239 EFL_UI_SLIDER_DATA_GET(obj, sd2); 1239 EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd2);
1240 1240
1241 dir = _direction_get(horizontal, _is_inverted(sd2->dir)); 1241 dir = _direction_get(horizontal, _is_inverted(sd2->dir));
1242 1242
@@ -1246,6 +1246,8 @@ elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
1246EAPI Eina_Bool 1246EAPI Eina_Bool
1247elm_slider_horizontal_get(const Evas_Object *obj) 1247elm_slider_horizontal_get(const Evas_Object *obj)
1248{ 1248{
1249 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1250
1249 Efl_Ui_Dir dir; 1251 Efl_Ui_Dir dir;
1250 dir = efl_ui_direction_get(obj); 1252 dir = efl_ui_direction_get(obj);
1251 1253
@@ -1280,7 +1282,7 @@ EAPI void
1280elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted) 1282elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted)
1281{ 1283{
1282 Efl_Ui_Dir dir; 1284 Efl_Ui_Dir dir;
1283 EFL_UI_SLIDER_DATA_GET(obj, sd2); 1285 EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd2);
1284 1286
1285 dir = _direction_get(_is_horizontal(sd2->dir), inverted); 1287 dir = _direction_get(_is_horizontal(sd2->dir), inverted);
1286 1288