mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
indev_button_proc: fix crash if points array not set (#1486)
This commit is contained in:
parent
929bbcaee4
commit
69b14a6146
@ -660,6 +660,12 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
*/
|
||||
static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
{
|
||||
/* Die gracefully if i->btn_points is NULL */
|
||||
if (i->btn_points == NULL) {
|
||||
LV_LOG_WARN("indev_button_proc: btn_points was NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
i->proc.types.pointer.act_point.x = i->btn_points[data->btn_id].x;
|
||||
i->proc.types.pointer.act_point.y = i->btn_points[data->btn_id].y;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user