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:
parent
f7c938a7b7
commit
cfe51b0cd1
1 changed files with 5 additions and 1 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue