From 6da490099b9ef853488ea308978fed149212f33b Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Tue, 22 Jun 2021 21:39:45 +0100 Subject: [PATCH] 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 --- apps/gui/bitmap/list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c index 6f6a8c1f7f..a82595fb37 100644 --- a/apps/gui/bitmap/list.c +++ b/apps/gui/bitmap/list.c @@ -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;