From f78c069e6ef62a34b7daf56f3bd4aed224c8858b Mon Sep 17 00:00:00 2001 From: XiaJianJun Date: Sun, 25 Apr 2021 15:39:31 +0800 Subject: [PATCH] (fix draw) txt add null pointer judgment to avoid segment fault --- src/lv_draw/lv_draw_label.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lv_draw/lv_draw_label.c b/src/lv_draw/lv_draw_label.c index 970791ffc..e73e01110 100644 --- a/src/lv_draw/lv_draw_label.c +++ b/src/lv_draw/lv_draw_label.c @@ -122,7 +122,11 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area int32_t w; /*No need to waste processor time if string is empty*/ - if(txt[0] == '\0') return; + if (txt != NULL) { + if(txt[0] == '\0') return; + } else { + return; + } lv_area_t clipped_area; bool clip_ok = _lv_area_intersect(&clipped_area, coords, mask);