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:
Jonathan Gordon 2008-10-05 09:17:05 +00:00
parent 5b3627f7fb
commit f397c25acf

View file

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