From 9e3a344454855f79b05b391551cb6f115ab6aa2a Mon Sep 17 00:00:00 2001 From: Jean Guyomarc'h Date: Tue, 29 Aug 2017 20:50:12 +0200 Subject: [PATCH] evas: fix invalid return of evas_textgrid_cellrow_get() evas_textgrid_cellrow_get() is supposed to return NULL if the row index fed to the function is outside of the textgrid's range. It was instead returning garbage pointer. @fix --- src/lib/evas/canvas/evas_object_textgrid.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c index 870db7be2a..0a46b04093 100644 --- a/src/lib/evas/canvas/evas_object_textgrid.c +++ b/src/lib/evas/canvas/evas_object_textgrid.c @@ -1410,14 +1410,11 @@ _evas_textgrid_cellrow_set(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o, int y, EOLIAN static Evas_Textgrid_Cell* _evas_textgrid_cellrow_get(const Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o, int y) { - Evas_Textgrid_Cell *ret; Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); evas_object_async_block(obj); - if ((y < 0) || (y >= o->cur.h)) ret = NULL; + if ((y < 0) || (y >= o->cur.h)) return NULL; - ret = o->cur.cells + (y * o->cur.w); - - return ret; + return o->cur.cells + (y * o->cur.w); } EOLIAN static void