core/playlists/system: Check that we read a valid playlist name
Otherwise we could crash when we try to access an out of bounds area of the playlist array. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
3098282382
commit
1d1e41916a
|
@ -53,7 +53,8 @@ static bool __sys_pl_load()
|
|||
file_readf(&sys_file, "%*u %m[^\n]\n", &name);
|
||||
|
||||
plist = __sys_pl_convert(name);
|
||||
queue_load_tracks(&sys_playlists[plist], &sys_file);
|
||||
if (plist < SYS_PL_NUM_PLAYLISTS)
|
||||
queue_load_tracks(&sys_playlists[plist], &sys_file);
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue