1
0
Fork 0
forked from len0rd/rockbox

playlist: pin dircache fileref buffer during background scanning

dircache_search() can yield, which would lead to memory corruption
if the playlist dcfrefs buffer is moved at that point. Prevent this
from happening by storing the buflib handle and pinning the buffer
while scanning the dircache.

Change-Id: I28b122de283953dd6d54c1d00598759f5bdcbe93
This commit is contained in:
Aidan MacDonald 2023-01-16 18:06:26 +00:00
parent 32f365bf3c
commit c307d98e3f
2 changed files with 68 additions and 70 deletions

View file

@ -107,7 +107,7 @@ struct playlist_info
int num_cached; /* number of cached entries */
struct mutex mutex; /* mutex for control file access */
#ifdef HAVE_DIRCACHE
struct dircache_fileref *dcfrefs; /* Dircache entry shortcuts */
int dcfrefs_handle;
#endif
int dirlen; /* Length of the path to the playlist file */
char filename[MAX_PATH]; /* path name of m3u playlist on disk */