From 151fa748060466f3137d71148285bdb69e076f41 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Sun, 29 Sep 2024 14:56:15 -0400 Subject: [PATCH] player/external_files: fix null deref when cover-art-whitelist is empty This can happen when using --cover-art-whitelist-clr. Fixes: d384a6b79303ef21b7330555e968a99d59a7c5b0 --- player/external_files.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/player/external_files.c b/player/external_files.c index 996344405f..82b39464a1 100644 --- a/player/external_files.c +++ b/player/external_files.c @@ -47,7 +47,7 @@ static int test_ext(MPOpts *opts, bstr ext) 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) { size_t size = n; while (cover_files[++size]);