mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Prevent segfault when accessing 'Explore' menu
This commit is contained in:
parent
ad13be13cd
commit
523e37ec95
@ -597,7 +597,22 @@ static explore_state_t *explore_build_list(void)
|
||||
key_str = key->val.string.buff;
|
||||
if (string_is_equal(key_str, "crc"))
|
||||
{
|
||||
crc32 = swap_if_little32(*(uint32_t*)val->val.binary.buff);
|
||||
switch (strlen(val->val.binary.buff))
|
||||
{
|
||||
case 1:
|
||||
crc32 = *(uint8_t*)val->val.binary.buff;
|
||||
break;
|
||||
case 2:
|
||||
crc32 = swap_if_little16(*(uint16_t*)val->val.binary.buff);
|
||||
break;
|
||||
case 4:
|
||||
crc32 = swap_if_little32(*(uint32_t*)val->val.binary.buff);
|
||||
break;
|
||||
default:
|
||||
crc32 = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
else if (string_is_equal(key_str, "name"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user