mirror of
https://github.com/mpv-player/mpv
synced 2025-01-18 04:51:52 +00:00
find_subfiles: fix really dumb bug causing segfaults
NULL pointer deref when a .sub file with the same filename as the video file was present. I was probably half asleep when writing this code.
This commit is contained in:
parent
95a2151d19
commit
82de39b7d5
@ -208,7 +208,7 @@ static void filter_subidx(struct subfn **slist, int *nsub)
|
||||
if (case_endswith(fname, ".idx")) {
|
||||
prev = fname;
|
||||
} else if (case_endswith(fname, ".sub")) {
|
||||
if (strncmp(prev, fname, strlen(fname) - 4) == 0)
|
||||
if (prev && strncmp(prev, fname, strlen(fname) - 4) == 0)
|
||||
(*slist)[n].priority = -1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user