From 7b3320baf4019f1129e68fe4361c245a762942c2 Mon Sep 17 00:00:00 2001 From: Paul Vogel <48995417+pfvogel@users.noreply.github.com> Date: Wed, 8 Jan 2025 12:57:47 -0600 Subject: [PATCH] fix(widget_chart): add assignment to uninitialized variable (#7561) --- src/widgets/chart/lv_chart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/widgets/chart/lv_chart.c b/src/widgets/chart/lv_chart.c index b22c1b755..8409a740e 100644 --- a/src/widgets/chart/lv_chart.c +++ b/src/widgets/chart/lv_chart.c @@ -266,6 +266,9 @@ void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint3 int32_t col_w = (block_w - (ser_gap * (ser_cnt - 1))) / ser_cnt; p_out->x += col_w / 2; } + else { + p_out->x = 0; + } int32_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); p_out->x += lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width;