From a92ffe7cde646c50ebfa8c9c29ce1cc4cfd68abf Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Fri, 14 Jun 2019 11:34:22 -0400 Subject: [PATCH] Fix use of NULL pointer in lv_draw_label --- src/lv_draw/lv_draw_label.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lv_draw/lv_draw_label.c b/src/lv_draw/lv_draw_label.c index 95ff2a9ec..6244668ef 100644 --- a/src/lv_draw/lv_draw_label.c +++ b/src/lv_draw/lv_draw_label.c @@ -99,7 +99,7 @@ void lv_draw_label(const lv_area_t * coords, const lv_area_t * mask, const lv_st } /*Use the hint if it's valid*/ - if(last_line_start >= 0) { + if(hint && last_line_start >= 0) { line_start = last_line_start; pos.y += hint->y; } @@ -114,7 +114,7 @@ void lv_draw_label(const lv_area_t * coords, const lv_area_t * mask, const lv_st pos.y += line_height; /*Save at the threshold coordinate*/ - if(pos.y >= -LV_LABEL_HINT_UPDATE_TH && hint->line_start < 0) { + if(hint && pos.y >= -LV_LABEL_HINT_UPDATE_TH && hint->line_start < 0) { hint->line_start = line_start; hint->y = pos.y - coords->y1; hint->coord_y = coords->y1;