From f7bc0df9bc32ff6f0f673c265bdb270005cb1417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Tue, 9 Jun 2015 17:02:28 -0300 Subject: [PATCH 1/3] (libretro_version_1.c) Change current_msg to a char array --- driver.h | 2 +- libretro_version_1.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/driver.h b/driver.h index b5a9961e4a..ceb4b607c9 100644 --- a/driver.h +++ b/driver.h @@ -299,7 +299,7 @@ typedef struct driver const video_poke_interface_t *video_poke; /* Last message given to the video driver */ - const char *current_msg; + char current_msg[PATH_MAX_LENGTH]; } driver_t; /** diff --git a/libretro_version_1.c b/libretro_version_1.c index 8e1dc136ba..843c970fa1 100644 --- a/libretro_version_1.c +++ b/libretro_version_1.c @@ -114,7 +114,10 @@ static void video_frame(const void *data, unsigned width, msg = rarch_main_msg_queue_pull(); - driver->current_msg = msg; + *driver->current_msg = 0; + + if (msg) + strlcpy(driver->current_msg, msg, sizeof(driver->current_msg)); if (video_driver_frame_filter(data, width, height, pitch, &output_width, &output_height, &output_pitch)) @@ -125,7 +128,7 @@ static void video_frame(const void *data, unsigned width, pitch = output_pitch; } - if (!video_driver_frame(data, width, height, pitch, msg)) + if (!video_driver_frame(data, width, height, pitch, driver->current_msg)) driver->video_active = false; } From c1c4f4128b21970ecbae45ccf83d0e534985d6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Tue, 9 Jun 2015 17:05:21 -0300 Subject: [PATCH 2/3] (playlist) Dont write the playlist file on free() --- playlist.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/playlist.c b/playlist.c index e35b17e09d..e359354cd7 100644 --- a/playlist.c +++ b/playlist.c @@ -270,8 +270,7 @@ void content_playlist_free(content_playlist_t *playlist) return; if (playlist->conf_path) - content_playlist_write_file(playlist); - free(playlist->conf_path); + free(playlist->conf_path); for (i = 0; i < playlist->cap; i++) content_playlist_free_entry(&playlist->entries[i]); From aa80b352eeb2aac3322e6f223063cb52580ef027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Tue, 9 Jun 2015 17:06:20 -0300 Subject: [PATCH 3/3] (playlist) Set conf_path and entries to NULL on free --- playlist.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/playlist.c b/playlist.c index e359354cd7..26040b9805 100644 --- a/playlist.c +++ b/playlist.c @@ -272,9 +272,13 @@ void content_playlist_free(content_playlist_t *playlist) if (playlist->conf_path) free(playlist->conf_path); + playlist->conf_path = NULL; + for (i = 0; i < playlist->cap; i++) content_playlist_free_entry(&playlist->entries[i]); + free(playlist->entries); + playlist->entries = NULL; free(playlist); }