player/external_files: fix null deref when cover-art-whitelist is empty

This can happen when using --cover-art-whitelist-clr.

Fixes: d384a6b793
This commit is contained in:
nanahi 2024-09-29 14:56:15 -04:00 committed by sfan5
parent 4c19df1ded
commit 151fa74806
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ static int test_ext(MPOpts *opts, bstr ext)
static int test_cover_filename(bstr fname, char **cover_files) static int test_cover_filename(bstr fname, char **cover_files)
{ {
for (int n = 0; cover_files[n]; n++) { for (int n = 0; cover_files && cover_files[n]; n++) {
if (bstrcasecmp(bstr0(cover_files[n]), fname) == 0) { if (bstrcasecmp(bstr0(cover_files[n]), fname) == 0) {
size_t size = n; size_t size = n;
while (cover_files[++size]); while (cover_files[++size]);