From 4bfc8f8243382fd339157439b0ba9fe1ac9142ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Thu, 31 Aug 2017 14:46:29 -0300 Subject: [PATCH] (xmb) Fix crash when toggling the menu --- menu/drivers/xmb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 94b8cfa7bc..31aeb6f284 100755 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -3961,6 +3961,10 @@ static void xmb_list_cache(void *data, enum menu_list_type type, unsigned action xmb_list_deep_copy(menu_stack, xmb->menu_stack_old); } + /* FIXME: this shouldn't be happening at all */ + if (selection >= xmb->selection_buf_old->size) + selection = xmb->selection_buf_old->size ? xmb->selection_buf_old->size - 1 : 0; + xmb->selection_ptr_old = selection; list_size = xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL)