From 03a9828a56095511d78e71bc4eb2ce5ee981a6b3 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 19 Jun 2023 10:28:23 +0200 Subject: [PATCH] fix(btnmatrix): fix array out of bounds addressing with groups and no buttons --- src/widgets/btnmatrix/lv_btnmatrix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/widgets/btnmatrix/lv_btnmatrix.c b/src/widgets/btnmatrix/lv_btnmatrix.c index adfe03f95..1df2281f1 100644 --- a/src/widgets/btnmatrix/lv_btnmatrix.c +++ b/src/widgets/btnmatrix/lv_btnmatrix.c @@ -521,6 +521,8 @@ static void lv_btnmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e) btnm->btn_id_sel = LV_BTNMATRIX_BTN_NONE; } else if(code == LV_EVENT_FOCUSED) { + if(btnm->btn_cnt == 0) return; + lv_indev_t * indev = lv_event_get_param(e); lv_indev_type_t indev_type = lv_indev_get_type(indev);