Commit 2bbf378d authored by Max Kellermann's avatar Max Kellermann

song: skip archive check for non-musicdir files

If a song is not within the music directory ("file:///..."), it has no "parent directory". The archive code nonetheless dereferences the parent pointer, causing a segmentation fault. Check parent!=NULL.
parent 7f3be96e
......@@ -78,7 +78,7 @@ song_file_load(const char *path, struct directory *parent)
song = song_file_new(path, parent);
//in archive ?
if (parent->device == DEVICE_INARCHIVE) {
if (parent != NULL && parent->device == DEVICE_INARCHIVE) {
ret = song_file_update_inarchive(song);
} else {
ret = song_file_update(song);
......
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