From 2bbf378dd8a3f12b4b79228ce562402c29d2cd09 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 17 Jan 2009 19:56:36 +0100 Subject: [PATCH] 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. --- src/song.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/song.c b/src/song.c index 2bb2b85b5..f40e50027 100644 --- a/src/song.c +++ b/src/song.c @@ -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);