mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 15:40:44 +00:00
Fix memory leaks and crashes
This commit is contained in:
parent
01099d526c
commit
66de49c987
@ -626,7 +626,8 @@ static void menu_action_setting_disp_set_label_menu_more(
|
||||
{
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MORE), len);
|
||||
*w = 19;
|
||||
strlcpy(s2, path, len2);
|
||||
if (path && !string_is_empty(path))
|
||||
strlcpy(s2, path, len2);
|
||||
}
|
||||
|
||||
static void menu_action_setting_disp_set_label_db_entry(
|
||||
@ -640,7 +641,8 @@ static void menu_action_setting_disp_set_label_db_entry(
|
||||
{
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MORE), len);
|
||||
*w = 10;
|
||||
strlcpy(s2, path, len2);
|
||||
if (path && !string_is_empty(path))
|
||||
strlcpy(s2, path, len2);
|
||||
}
|
||||
|
||||
static void menu_action_setting_disp_set_label_entry(
|
||||
|
@ -2331,7 +2331,10 @@ static int xmb_draw_item(
|
||||
}
|
||||
else
|
||||
{
|
||||
enum msg_file_type type = msg_hash_to_file_type(msg_hash_calculate(entry->value));
|
||||
enum msg_file_type type = FILE_TYPE_NONE;
|
||||
|
||||
if (entry->value && !string_is_empty(entry->value))
|
||||
type = msg_hash_to_file_type(msg_hash_calculate(entry->value));
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@ -2409,10 +2412,13 @@ static int xmb_draw_item(
|
||||
ticker.s = tmp;
|
||||
ticker.len = 35;
|
||||
ticker.idx = frame_count / 20;
|
||||
ticker.str = entry->value;
|
||||
ticker.selected = (i == current);
|
||||
|
||||
menu_animation_ticker(&ticker);
|
||||
if (entry->value && !string_is_empty(entry->value))
|
||||
{
|
||||
ticker.str = entry->value;
|
||||
menu_animation_ticker(&ticker);
|
||||
}
|
||||
|
||||
if (do_draw_text)
|
||||
xmb_draw_text(menu_disp_info, xmb, tmp,
|
||||
|
@ -264,7 +264,7 @@ void menu_entry_reset(uint32_t i)
|
||||
|
||||
void menu_entry_get_value(menu_entry_t *entry, char *s, size_t len)
|
||||
{
|
||||
if (!entry)
|
||||
if (!entry || !entry->value || string_is_empty(entry->value))
|
||||
return;
|
||||
strlcpy(s, entry->value, len);
|
||||
}
|
||||
@ -333,11 +333,11 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx,
|
||||
|
||||
cbs->action_get_value(list,
|
||||
&entry->spacing, entry->type, (unsigned)i, label,
|
||||
entry->value,
|
||||
255 * sizeof(char),
|
||||
entry_label, path,
|
||||
tmp,
|
||||
sizeof(tmp)
|
||||
sizeof(tmp),
|
||||
entry_label, path,
|
||||
newpath,
|
||||
sizeof(newpath)
|
||||
);
|
||||
|
||||
if (!string_is_empty(tmp))
|
||||
|
Loading…
x
Reference in New Issue
Block a user