summaryrefslogtreecommitdiff
path: root/apps/playlist_viewer.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playlist_viewer.c')
-rw-r--r--apps/playlist_viewer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index d2774e67b0..f1f8954113 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -516,7 +516,10 @@ static enum pv_onplay_result open_with(const struct playlist_entry *current_trac
516{ 516{
517 char selected_track[MAX_PATH]; 517 char selected_track[MAX_PATH];
518 close_playlist_viewer(); 518 close_playlist_viewer();
519 snprintf(selected_track, sizeof(selected_track), "%s", current_track->name); 519
520 if (!memccpy (selected_track, current_track->name, '\0', sizeof(selected_track)))
521 selected_track[sizeof(selected_track) - 1] = '\0';
522
520 523
521 return (filetype_list_viewers(selected_track) == 524 return (filetype_list_viewers(selected_track) ==
522 PLUGIN_USB_CONNECTED ? PV_ONPLAY_USB_CLOSED : PV_ONPLAY_CLOSED); 525 PLUGIN_USB_CONNECTED ? PV_ONPLAY_USB_CLOSED : PV_ONPLAY_CLOSED);
@@ -528,7 +531,9 @@ static enum pv_onplay_result open_pictureflow(const struct playlist_entry *curre
528{ 531{
529 char selected_track[MAX_PATH]; 532 char selected_track[MAX_PATH];
530 close_playlist_viewer(); 533 close_playlist_viewer();
531 snprintf(selected_track, sizeof(selected_track), "%s", current_track->name); 534
535 if (!memccpy (selected_track, current_track->name, '\0', sizeof(selected_track)))
536 selected_track[sizeof(selected_track) - 1] = '\0';
532 537
533 return (filetype_load_plugin((void *)"pictureflow", selected_track) == 538 return (filetype_load_plugin((void *)"pictureflow", selected_track) ==
534 PLUGIN_USB_CONNECTED ? PV_ONPLAY_USB_CLOSED : PV_ONPLAY_CLOSED); 539 PLUGIN_USB_CONNECTED ? PV_ONPLAY_USB_CLOSED : PV_ONPLAY_CLOSED);