Commit d69fda91 authored by Michael Niedermayer's avatar Michael Niedermayer

lavf: check stream_index from read_packet() for validity.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent f36ce75e
......@@ -762,6 +762,11 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt)
if(!(s->flags & AVFMT_FLAG_KEEP_SIDE_DATA))
av_packet_merge_side_data(pkt);
if(pkt->stream_index >= (unsigned)s->nb_streams){
av_log(s, AV_LOG_ERROR, "Invalid stream index %d\n", pkt->stream_index);
continue;
}
st= s->streams[pkt->stream_index];
switch(st->codec->codec_type){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment