1
0
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:
fstengel 2020-05-04 15:56:13 +02:00 committed by GitHub
parent 929bbcaee4
commit 69b14a6146
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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