diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-10-12 01:04:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-12 01:04:12 +0200 |
commit | d69fda9127986dc56a5f1bbc00e7a9d72305d573 (patch) | |
tree | e18765d60ee15bab5b8ba6b54174ad3442be0232 /libavformat | |
parent | f36ce75e35c49152b5570118df04f9f7d8e8d2f5 (diff) | |
download | ffmpeg-d69fda9127986dc56a5f1bbc00e7a9d72305d573.tar.gz |
lavf: check stream_index from read_packet() for validity.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index d98a17aeda..58982955de 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -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){ |