1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Nicolas Pennequin 2008-02-05 11:56:21 +00:00
parent f7c938a7b7
commit cfe51b0cd1

View file

@ -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),