mirror of
https://github.com/mpv-player/mpv
synced 2025-01-29 11:12:56 +00:00
player: don't sort a NULL list
This can occur if the directory does not have any files in it which causes files to never be non-NULL for qsort.
This commit is contained in:
parent
a95cfac078
commit
e023524481
@ -151,7 +151,8 @@ static char **list_script_files(void *talloc_ctx, char *path)
|
||||
MP_TARRAY_APPEND(talloc_ctx, files, count, fname);
|
||||
}
|
||||
closedir(dp);
|
||||
qsort(files, count, sizeof(char *), compare_filename);
|
||||
if (files)
|
||||
qsort(files, count, sizeof(char *), compare_filename);
|
||||
MP_TARRAY_APPEND(talloc_ctx, files, count, NULL);
|
||||
return files;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user