Fix pointer overflow

This commit is contained in:
twinaphex 2017-05-28 17:53:45 +02:00
parent 2f39e4cd33
commit 66f056322a
2 changed files with 7 additions and 3 deletions

View File

@ -930,7 +930,7 @@ static void xmb_update_thumbnail_path(void *data, unsigned i)
playlist_get_index(playlist, i,
NULL, NULL, NULL, &core_name, NULL, NULL);
if (core_name && string_is_equal_fast(core_name, "imageviewer", 11))
if (string_is_equal(core_name, "imageviewer"))
{
strlcpy(xmb->thumbnail_file_path, entry.label,
sizeof(xmb->thumbnail_file_path));

View File

@ -2198,10 +2198,14 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
break;
case MENU_NAVIGATION_CTL_ADD_SCROLL_INDEX:
{
size_t *sel = (size_t*)data;
size_t *sel = (size_t*)data;
if (!sel)
return false;
scroll_index_list[scroll_index_size++] = *sel;
if ((scroll_index_size + 1) >= SCROLL_INDEX_SIZE)
scroll_index_list[scroll_index_size] = *sel;
else
scroll_index_list[scroll_index_size++] = *sel;
}
break;
case MENU_NAVIGATION_CTL_GET_SCROLL_ACCEL: