diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2023-01-16 18:06:26 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2023-01-22 13:47:50 +0000 |
commit | c307d98e3fbe5e867cd6e6e3c61f4937021c6b4c (patch) | |
tree | 3ae7d5b34a6c6f72a2dd50737dfe278db934446a /apps/playlist.h | |
parent | 32f365bf3cdcaadb22087041bfc44574737b557d (diff) | |
download | rockbox-c307d98e3fbe5e867cd6e6e3c61f4937021c6b4c.tar.gz rockbox-c307d98e3fbe5e867cd6e6e3c61f4937021c6b4c.zip |
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
Diffstat (limited to 'apps/playlist.h')
-rw-r--r-- | apps/playlist.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/playlist.h b/apps/playlist.h index ef943f1bd9..86c0c293ab 100644 --- a/apps/playlist.h +++ b/apps/playlist.h | |||
@@ -107,7 +107,7 @@ struct playlist_info | |||
107 | int num_cached; /* number of cached entries */ | 107 | int num_cached; /* number of cached entries */ |
108 | struct mutex mutex; /* mutex for control file access */ | 108 | struct mutex mutex; /* mutex for control file access */ |
109 | #ifdef HAVE_DIRCACHE | 109 | #ifdef HAVE_DIRCACHE |
110 | struct dircache_fileref *dcfrefs; /* Dircache entry shortcuts */ | 110 | int dcfrefs_handle; |
111 | #endif | 111 | #endif |
112 | int dirlen; /* Length of the path to the playlist file */ | 112 | int dirlen; /* Length of the path to the playlist file */ |
113 | char filename[MAX_PATH]; /* path name of m3u playlist on disk */ | 113 | char filename[MAX_PATH]; /* path name of m3u playlist on disk */ |