Touchscreen: absolute point mode scrolling bugfix

Due to this inadequate bounds check, it was possible under certain
conditions to cause a crash by touching & scrolling in the empty
space "after" the last item of a list.

Change-Id: Ic6c30214d887e1c7ccb212de272248ca24f60856
This commit is contained in:
Aidan MacDonald 2021-06-22 21:39:45 +01:00
parent 76e07a7fd2
commit 6da490099b

View file

@ -734,7 +734,7 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * list)
if (list_display_title(list, screen))
line -= 1; /* adjust for the list title */
}
if (line >= list->nb_items)
if (list_start_item+line >= list->nb_items)
return ACTION_NONE;
list->selected_item = list_start_item+line;