From 5f85967da1501e07ef0500df8b36a8502321130c Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Mon, 16 May 2022 18:36:56 +0100 Subject: [PATCH] evas - textgrid - guard against null/empty glyphs not sure how someone got to this point - but this should not be null, so don't crash if it is. @fix --- src/lib/evas/canvas/evas_object_textgrid.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c index 2d9b143452..0b5a335508 100644 --- a/src/lib/evas/canvas/evas_object_textgrid.c +++ b/src/lib/evas/canvas/evas_object_textgrid.c @@ -379,7 +379,8 @@ _drop_glyphs_ref(const void *container EINA_UNUSED, void *data, void *fdata) Evas_Font_Array_Data *fad = data; Evas_Public_Data *pd = fdata; - evas_common_font_glyphs_unref(fad->glyphs); + if (fad->glyphs) + evas_common_font_glyphs_unref(fad->glyphs); eina_array_pop(&pd->glyph_unref_queue); return EINA_TRUE; @@ -553,10 +554,12 @@ evas_object_textgrid_render(Evas_Object *eo_obj EINA_UNUSED, props = &text->text_props; evas_common_font_draw_prepare(props); - - evas_common_font_glyphs_ref(props->glyphs); - evas_unref_queue_glyph_put(obj->layer->evas, - props->glyphs); + if (props->glyphs) + { + evas_common_font_glyphs_ref(props->glyphs); + evas_unref_queue_glyph_put(obj->layer->evas, + props->glyphs); + } fad = eina_inarray_grow(texts->array, 1); if (!fad)