summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamir Benmendil <me@rmz.io>2021-08-15 12:46:22 +0100
committerMax Kellermann <max@musicpd.org>2021-08-17 10:55:43 +0200
commitcfe024ea138d3c9f72ac2875c22e75cc9517b52a (patch)
treef526eecb32166df80bdb350747c6c1e56c04ca5b
parent993d85125e699774e31a32af3e7a5f61291e3fb4 (diff)
command/file: return directory_uri if real_uri is unsetv0.22.x
Prevent a segfault when accessing album art. Fix #1224 #1225
-rw-r--r--NEWS2
-rw-r--r--src/command/FileCommands.cxx3
2 files changed, 5 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index e918c8150..a22eb7d63 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
ver 0.22.11 (not yet released)
+* protocol
+ - fix "albumart" crash
ver 0.22.10 (2021/08/06)
* protocol
diff --git a/src/command/FileCommands.cxx b/src/command/FileCommands.cxx
index 1a2b3b8c4..e6ff5672d 100644
--- a/src/command/FileCommands.cxx
+++ b/src/command/FileCommands.cxx
@@ -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