mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
7252e4f8ee
commit
9949c1dd78
|
@ -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);
|
return AVERROR(EINVAL);
|
||||||
for (unsigned j = 0; j < s->stream_groups[group_idx]->nb_streams; j++) {
|
for (unsigned j = 0; j < s->stream_groups[group_idx]->nb_streams; j++) {
|
||||||
if (st->index == s->stream_groups[group_idx]->streams[j]->index) {
|
if (st->index == s->stream_groups[group_idx]->streams[j]->index) {
|
||||||
|
|
Loading…
Reference in New Issue