summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2008-02-05 11:56:21 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2008-02-05 11:56:21 +0000
commitcfe51b0cd168f470bcbd028cb5fbfddf9839c76a (patch)
treea08e9c7f396f125c8421ab7bb690c0f97eb5a72d
parentf7c938a7b730c2149f93db5c66b1336835e0a81e (diff)
downloadrockbox-cfe51b0cd168f470bcbd028cb5fbfddf9839c76a.zip
rockbox-cfe51b0cd168f470bcbd028cb5fbfddf9839c76a.tar.gz
rockbox-cfe51b0cd168f470bcbd028cb5fbfddf9839c76a.tar.bz2
rockbox-cfe51b0cd168f470bcbd028cb5fbfddf9839c76a.tar.xz
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
-rw-r--r--apps/recorder/albumart.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c
index 13969d7..c4d3a0e 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),