diff options
author | Max Kellermann <max@duempel.org> | 2009-01-17 19:56:36 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-17 19:56:36 +0100 |
commit | 2bbf378dd8a3f12b4b79228ce562402c29d2cd09 (patch) | |
tree | 47985e2fc1bf22b44c7f560f8b5a4e0ae836418b /src/song.c | |
parent | 7f3be96efa222aba1661adf2fc83a0e60e8b9aef (diff) | |
download | mpd-2bbf378dd8a3f12b4b79228ce562402c29d2cd09.tar.gz mpd-2bbf378dd8a3f12b4b79228ce562402c29d2cd09.tar.xz mpd-2bbf378dd8a3f12b4b79228ce562402c29d2cd09.zip |
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.
Diffstat (limited to 'src/song.c')
-rw-r--r-- | src/song.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |