mirror of https://github.com/mpv-player/mpv
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);
|
MP_TARRAY_APPEND(talloc_ctx, files, count, fname);
|
||||||
}
|
}
|
||||||
closedir(dp);
|
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);
|
MP_TARRAY_APPEND(talloc_ctx, files, count, NULL);
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue