command/file: return directory_uri if real_uri is unset

Prevent a segfault when accessing album art.

Fix #1224 #1225
This commit is contained in:
Samir Benmendil 2021-08-15 12:46:22 +01:00 committed by Max Kellermann
parent 993d85125e
commit cfe024ea13
2 changed files with 5 additions and 0 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.22.11 (not yet released)
* protocol
- fix "albumart" crash
ver 0.22.10 (2021/08/06)
* protocol

View File

@ -267,6 +267,9 @@ try {
AtScopeExit(db, song) { db->ReturnSong(song); };
if (song->real_uri == nullptr)
return directory_uri;
const char *real_uri = song->real_uri;
/* this is a simplification which is just enough for CUE