From cfe51b0cd168f470bcbd028cb5fbfddf9839c76a Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Tue, 5 Feb 2008 11:56:21 +0000 Subject: [PATCH] Add a couple safety checks in search_albumart_files(). Should fix the sliding_puzzle crashes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16225 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/albumart.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c index 13969d77e5..c4d3a0e0bd 100644 --- a/apps/recorder/albumart.c +++ b/apps/recorder/albumart.c @@ -115,6 +115,10 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, return false; trackname = id3->path; + + if (strcmp(trackname, "No file!") == 0) + return false; + strip_filename(dir, sizeof(dir), trackname); dirlen = strlen(dir); albumlen = id3->album ? strlen(id3->album) : 0; @@ -142,7 +146,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, found = file_exists(path); } - if (!found) + if (!found && id3->artist && id3->album) { /* look in the albumart subdir of .rockbox */ snprintf(path, sizeof(path),