Skip to content

Commit f8e9486

Browse files
authored
Core option setting type checks (libretro#14852)
1 parent f347c2d commit f8e9486

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

menu/menu_driver.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,19 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx,
398398
if (cbs->setting && cbs->setting->type)
399399
entry->setting_type = cbs->setting->type;
400400

401+
/* Exceptions without cbs->setting->type */
402+
if (!entry->setting_type)
403+
{
404+
switch (entry->type)
405+
{
406+
case MENU_SETTING_ACTION_CORE_LOCK:
407+
entry->setting_type = ST_BOOL;
408+
break;
409+
default:
410+
break;
411+
}
412+
}
413+
401414
if (cbs->checked)
402415
entry->flags |= MENU_ENTRY_FLAG_CHECKED;
403416

@@ -476,9 +489,11 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx,
476489
core_option_manager_t *coreopts = NULL;
477490
size_t option_index = entry->type - MENU_SETTINGS_CORE_OPTION_START;
478491
retroarch_ctl(RARCH_CTL_CORE_OPTIONS_LIST_GET, &coreopts);
479-
option = (struct core_option*)&coreopts->opts[option_index];
480492

481-
if (option->vals->size == 2)
493+
if (coreopts)
494+
option = (struct core_option*)&coreopts->opts[option_index];
495+
496+
if (option && option->vals && option->vals->size == 2)
482497
entry->setting_type = ST_BOOL;
483498
}
484499

0 commit comments

Comments
 (0)