Fix a possible deadlock if the album art loading fails
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18711 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5b3627f7fb
commit
f397c25acf
1 changed files with 1 additions and 2 deletions
|
@ -944,11 +944,11 @@ int bufopen(const char *file, size_t offset, enum data_type type)
|
|||
int rc;
|
||||
mutex_lock(&llist_mutex); /* Lock because load_bitmap yields */
|
||||
rc = load_bitmap(fd);
|
||||
mutex_unlock(&llist_mutex);
|
||||
if (rc <= 0)
|
||||
{
|
||||
rm_handle(h);
|
||||
close(fd);
|
||||
mutex_unlock(&llist_mutex);
|
||||
return ERR_FILE_ERROR;
|
||||
}
|
||||
h->filerem = 0;
|
||||
|
@ -956,7 +956,6 @@ int bufopen(const char *file, size_t offset, enum data_type type)
|
|||
h->available = rc;
|
||||
h->widx = buf_widx + rc; /* safe because the data doesn't wrap */
|
||||
buf_widx += rc; /* safe too */
|
||||
mutex_unlock(&llist_mutex);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue