1
0
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:
Gabriel Peixoto 2013-09-08 02:24:30 -03:00 committed by wm4
parent 35fd083828
commit 856c58aa9c

View File

@ -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);
}