diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c index 3729adee2f..c1d90360b4 100644 --- a/libavformat/asfdec_o.c +++ b/libavformat/asfdec_o.c @@ -854,6 +854,8 @@ static int asf_read_ext_stream_properties(AVFormatContext *s, const GUIDParseTab st_num = avio_rl16(pb); st_num &= ASF_STREAM_NUM; lang_idx = avio_rl16(pb); // Stream Language ID Index + if (lang_idx >= ASF_MAX_STREAMS) + return AVERROR_INVALIDDATA; for (i = 0; i < asf->nb_streams; i++) { if (st_num == asf->asf_st[i]->stream_index) { st = s->streams[asf->asf_st[i]->index];