mirror of
https://github.com/libretro/RetroArch
synced 2025-04-03 19:20:24 +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;
|
key_str = key->val.string.buff;
|
||||||
if (string_is_equal(key_str, "crc"))
|
if (string_is_equal(key_str, "crc"))
|
||||||
{
|
{
|
||||||
|
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);
|
crc32 = swap_if_little32(*(uint32_t*)val->val.binary.buff);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
crc32 = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (string_is_equal(key_str, "name"))
|
else if (string_is_equal(key_str, "name"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user