From 5a7f736d9556fdddb4a20dc855ecd1ee15c816d6 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Tue, 18 Nov 2014 20:56:47 +0000 Subject: [PATCH] Fix crash when appending a line off and the body is already larger than the viewport --- elm_code/lib/elm_code_widget.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/elm_code/lib/elm_code_widget.c b/elm_code/lib/elm_code_widget.c index 32e00de..ba096e4 100644 --- a/elm_code/lib/elm_code_widget.c +++ b/elm_code/lib/elm_code_widget.c @@ -111,12 +111,18 @@ _elm_code_widget_line_cb(void *data EINA_UNUSED, Eo *obj, { Elm_Code_Line *line; Evas_Object *o; + int h; Evas_Textgrid_Cell *cells; line = (Elm_Code_Line *)event_info; o = (Evas_Object *)obj; + evas_object_textgrid_size_get(o, NULL, &h); + + if (line->number > (unsigned int) h) + return EINA_TRUE; + cells = evas_object_textgrid_cellrow_get(o, line->number - 1); _elm_code_widget_fill_line(o, cells, line);