aboutsummaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-04-24 08:13:20 +0200
committerMax Kellermann <max@duempel.org>2014-04-24 08:19:08 +0200
commitc9aec3e8666628c87b55657ae506a1bd4d27859d (patch)
tree9684c6572ab957e831704af9a26fdebd8279acf9 /src/db
parent1d1f8be26070aea8bfc79a4f43d0e7a5343f60d9 (diff)
downloadmpd-c9aec3e8666628c87b55657ae506a1bd4d27859d.tar.gz
mpd-c9aec3e8666628c87b55657ae506a1bd4d27859d.tar.xz
mpd-c9aec3e8666628c87b55657ae506a1bd4d27859d.zip
DatabaseCommands: fix crash on "list base"
The string "base" is understood by locate_parse_type(), but not by listAllUniqueTags(). The special tag type LOCATE_TAG_BASE_TYPE causes a crash in PrintUniqueTag().
Diffstat (limited to 'src/db')
-rw-r--r--src/db/DatabasePrint.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/db/DatabasePrint.cxx b/src/db/DatabasePrint.cxx
index 2a13b28e6..781866272 100644
--- a/src/db/DatabasePrint.cxx
+++ b/src/db/DatabasePrint.cxx
@@ -261,6 +261,8 @@ listAllUniqueTags(Client &client, unsigned type,
std::ref(client), _1);
return db->Visit(selection, f, error);
} else {
+ assert(type < TAG_NUM_OF_ITEM_TYPES);
+
using namespace std::placeholders;
const auto f = std::bind(PrintUniqueTag, std::ref(client),
(TagType)type, _1);