From 9d89e6910ef356caf626cbdb9d1d7104e3dc62ef Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sat, 5 Jul 2014 20:51:55 +0200 Subject: artwork: fixed crash when showing album art in notification for untagged tracks (bug #1144) --- plugins/artwork/artwork.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'plugins/artwork') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index a6c27172..e69c61e4 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -144,10 +144,15 @@ make_cache_dir_path (char *path, int size, const char *artist, int img_size) { char esc_artist[PATH_MAX]; int i; - for (i = 0; artist[i]; i++) { - esc_artist[i] = esc_char (artist[i]); + if (artist) { + for (i = 0; artist[i]; i++) { + esc_artist[i] = esc_char (artist[i]); + } + esc_artist[i] = 0; + } + else { + strcpy (esc_artist, "Unknown artist"); } - esc_artist[i] = 0; const char *cache = getenv ("XDG_CACHE_HOME"); int sz; -- cgit v1.2.3