diff --git a/sub/find_subfiles.c b/sub/find_subfiles.c index f272e84e73..691c0148d3 100644 --- a/sub/find_subfiles.c +++ b/sub/find_subfiles.c @@ -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); }