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
This commit is contained in:
orbea 2019-01-07 17:31:01 -08:00
parent 35f6dd640d
commit 098dc61ad3

View File

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