From 098dc61ad3742477d51f69bda22f2cb4f8697048 Mon Sep 17 00:00:00 2001 From: orbea Date: Mon, 7 Jan 2019 17:31:01 -0800 Subject: [PATCH] Fix crash with quick menu options. If the 'game specific options' setting is disabled the drop down menu for the core options will crash on the first option and then have an offset with all of the additional options. Fixes https://github.com/libretro/RetroArch/issues/7915 --- menu/menu_displaylist.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index d7dfe56005..d07b96eeb8 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -8140,19 +8140,26 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist if (tmp_str_list && tmp_str_list->size > 0) { core_option_manager_t *coreopts = NULL; + const char *val = NULL; rarch_ctl(RARCH_CTL_CORE_OPTIONS_LIST_GET, &coreopts); if (coreopts) { + settings_t *settings = config_get_ptr(); unsigned size = (unsigned)tmp_str_list->size; unsigned i = atoi(tmp_str_list->elems[size-1].data); struct core_option *option = NULL; bool checked_found = false; unsigned checked = 0; - const char *val = core_option_manager_get_val(coreopts, i-1); - i--; + if (settings->bools.game_specific_options) + { + val = core_option_manager_get_val(coreopts, i-1); + i--; + } + else + val = core_option_manager_get_val(coreopts, i); option = (struct core_option*)&coreopts->opts[i];