aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-01-30 17:21:56 -0300
committerJames Almer <jamrial@gmail.com>2024-01-30 17:23:20 -0300
commit9949c1dd7834a4b15b0ae67aa1ec7b280fb068c2 (patch)
tree51a18ff2ba5bc219af9847b5999623c131a9547f
parent7252e4f8eeb5424a25cdd836a2238d97c7348d84 (diff)
downloadffmpeg-9949c1dd7834a4b15b0ae67aa1ec7b280fb068c2.tar.gz
avformat/avformat: fix group index range check in match_stream_specifier()
Fixes segfaults when trying to map a group index with a value equal to the amount of groups in the file. Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/avformat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/avformat.c b/libavformat/avformat.c
index 882927f7b1..8e8c6fbe55 100644
--- a/libavformat/avformat.c
+++ b/libavformat/avformat.c
@@ -551,7 +551,7 @@ static int match_stream_specifier(const AVFormatContext *s, const AVStream *st,
}
}
}
- if (group_idx < 0 || group_idx > s->nb_stream_groups)
+ if (group_idx < 0 || group_idx >= s->nb_stream_groups)
return AVERROR(EINVAL);
for (unsigned j = 0; j < s->stream_groups[group_idx]->nb_streams; j++) {
if (st->index == s->stream_groups[group_idx]->streams[j]->index) {