From cce86661406db3901df8b41cb620338b4445ceb6 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Wed, 28 Feb 2018 10:28:59 -0500 Subject: [PATCH] core/tags/album: Check for empty artist names before fetching album art Otherwise we might crash when we attempt to look at ar_tokens[0]. Reported-by: Josh Larson Signed-off-by: Anna Schumaker --- core/tags/album.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/tags/album.c b/core/tags/album.c index f8bce5d0..8396f52a 100644 --- a/core/tags/album.c +++ b/core/tags/album.c @@ -138,7 +138,8 @@ static bool __album_query_artist(struct album *album, struct artist *al_artist, gchar *release, *artist, *year; bool found = false; - if (!al_artist || strcmp(al_artist->ar_tokens[0], "various") == 0) + if (!al_artist || !string_length(al_artist->ar_name) || + strcmp(al_artist->ar_tokens[0], "various") == 0) return false; release = g_strdup_printf("release:\"%s\"~", lower);