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:
Max Kellermann 2009-01-17 19:56:36 +01:00
parent 7f3be96efa
commit 2bbf378dd8
1 changed files with 1 additions and 1 deletions

View File

@ -78,7 +78,7 @@ song_file_load(const char *path, struct directory *parent)
song = song_file_new(path, parent); song = song_file_new(path, parent);
//in archive ? //in archive ?
if (parent->device == DEVICE_INARCHIVE) { if (parent != NULL && parent->device == DEVICE_INARCHIVE) {
ret = song_file_update_inarchive(song); ret = song_file_update_inarchive(song);
} else { } else {
ret = song_file_update(song); ret = song_file_update(song);