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.
This commit is contained in:
parent
7f3be96efa
commit
2bbf378dd8
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue