mirror of
https://github.com/mpv-player/mpv
synced 2025-03-20 10:17:31 +00:00
find_subfiles: fix off-by-1 error
This could lead to a segfault, fixes #219 Signed-off-by: Gabriel Peixoto <gabrielrcp@gmail.com> Signed-off-by: wm4 <wm4@nowhere>
This commit is contained in:
parent
35fd083828
commit
856c58aa9c
@ -212,7 +212,7 @@ static void filter_subidx(struct subfn **slist, int *nsub)
|
||||
(*slist)[n].priority = -1;
|
||||
}
|
||||
}
|
||||
for (int n = *nsub; n >= 0; n--) {
|
||||
for (int n = *nsub - 1; n >= 0; n--) {
|
||||
if ((*slist)[n].priority < 0)
|
||||
MP_TARRAY_REMOVE_AT(*slist, *nsub, n);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user