diff --git a/menu/menu.c b/menu/menu.c index 524cef4fad..6804600e24 100644 --- a/menu/menu.c +++ b/menu/menu.c @@ -144,9 +144,6 @@ bool menu_load_content(void) driver_t *driver = driver_get_ptr(); global_t *global = global_get_ptr(); - if (*global->fullpath || (driver->menu && driver->menu->load_no_content)) - push_to_history_playlist(); - /* redraw menu frame */ if (driver->menu) driver->menu->msg_force = true; @@ -175,6 +172,10 @@ bool menu_load_content(void) menu_shader_manager_init(driver->menu); rarch_main_command(RARCH_CMD_HISTORY_INIT); + + if (*global->fullpath || (driver->menu && driver->menu->load_no_content)) + push_to_history_playlist(); + rarch_main_command(RARCH_CMD_VIDEO_SET_ASPECT_RATIO); rarch_main_command(RARCH_CMD_RESUME); diff --git a/playlist.c b/playlist.c index e4c131cd96..2c21f6efa2 100644 --- a/playlist.c +++ b/playlist.c @@ -18,6 +18,7 @@ #include "playlist.h" #include #include +#include "retroarch_logger.h" #include #include @@ -116,6 +117,15 @@ void content_playlist_push(content_playlist_t *playlist, if (!playlist) return; + if (!core_path || !*core_path || !core_name || !*core_name) + { + RARCH_ERR("cannot push NULL or empty core info into the playlist"); + return; + } + + if (path && !*path) + path = NULL; + for (i = 0; i < playlist->size; i++) { content_playlist_entry_t tmp; @@ -155,8 +165,8 @@ void content_playlist_push(content_playlist_t *playlist, (playlist->cap - 1) * sizeof(content_playlist_entry_t)); playlist->entries[0].path = path ? strdup(path) : NULL; - playlist->entries[0].core_path = core_path ? strdup(core_path) : NULL; - playlist->entries[0].core_name = core_name ? strdup(core_name) : NULL; + playlist->entries[0].core_path = strdup(core_path); + playlist->entries[0].core_name = strdup(core_name); playlist->size++; }