perf(line): check that line has at least 2 points before drawing (#9185)

This commit is contained in:
蒋慧赟
2025-11-04 05:09:48 +08:00
committed by GitHub
parent 271f12973a
commit 399bde8dec
+1 -1
View File
@@ -227,7 +227,7 @@ static void lv_line_event(const lv_obj_class_t * class_p, lv_event_t * e)
lv_line_t * line = (lv_line_t *)obj;
lv_layer_t * layer = lv_event_get_layer(e);
if(line->point_num == 0 || line->point_array.constant == NULL) return;
if(line->point_num < 2 || line->point_array.constant == NULL) return;
lv_area_t area;
lv_obj_get_coords(obj, &area);