Commit 8fb20fcd authored by Max Kellermann's avatar Max Kellermann

playlist_song: fix potential charset bug in apply_song_metadata()

The song's URI must be UTF-8, not filesystem character set.
parent 72bf2266
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "mapper.h" #include "mapper.h"
#include "song.h" #include "song.h"
#include "uri.h" #include "uri.h"
#include "path.h"
#include "ls.h" #include "ls.h"
#include "tag.h" #include "tag.h"
...@@ -62,8 +63,14 @@ apply_song_metadata(struct song *dest, const struct song *src) ...@@ -62,8 +63,14 @@ apply_song_metadata(struct song *dest, const struct song *src)
if (path_fs == NULL) if (path_fs == NULL)
return dest; return dest;
tmp = song_file_new(path_fs, NULL); char *path_utf8 = fs_charset_to_utf8(path_fs);
g_free(path_fs); if (path_utf8 != NULL)
g_free(path_fs);
else
path_utf8 = path_fs;
tmp = song_file_new(path_utf8, NULL);
g_free(path_utf8);
merge_song_metadata(tmp, dest, src); merge_song_metadata(tmp, dest, src);
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment