mirror of https://github.com/mpv-player/mpv
tl_matroska: fix NULL pointer issue
Found by clang analyzer. Probably doesn't matter in practice, because the number of entries was 0 when entries was NULL.
This commit is contained in:
parent
0212d7e804
commit
73f866e7eb
|
@ -103,7 +103,8 @@ static char **find_files(const char *original_file, const char *suffix)
|
|||
}
|
||||
closedir(dp);
|
||||
// NOTE: maybe should make it compare pointers instead
|
||||
qsort(entries, num_results, sizeof(struct find_entry), cmp_entry);
|
||||
if (entries)
|
||||
qsort(entries, num_results, sizeof(struct find_entry), cmp_entry);
|
||||
results = talloc_realloc(NULL, results, char *, num_results);
|
||||
for (int i = 0; i < num_results; i++) {
|
||||
results[i] = entries[i].name;
|
||||
|
|
Loading…
Reference in New Issue