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

(fix draw) txt add null pointer judgment to avoid segment fault

This commit is contained in:
XiaJianJun 2021-04-25 15:39:31 +08:00
parent dfc6719479
commit f78c069e6e

View File

@ -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);