1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-21 06:53:01 +08:00

Fix use of NULL pointer in lv_draw_label

This commit is contained in:
Themba Dube 2019-06-14 11:34:22 -04:00
parent 5bb1653991
commit a92ffe7cde

View File

@ -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*/ /*Use the hint if it's valid*/
if(last_line_start >= 0) { if(hint && last_line_start >= 0) {
line_start = last_line_start; line_start = last_line_start;
pos.y += hint->y; 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; pos.y += line_height;
/*Save at the threshold coordinate*/ /*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->line_start = line_start;
hint->y = pos.y - coords->y1; hint->y = pos.y - coords->y1;
hint->coord_y = coords->y1; hint->coord_y = coords->y1;