summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-03-20 12:27:42 +0100
committerNicolas George <nicolas.george@normalesup.org>2013-03-20 13:35:24 +0100
commit0d09aa9d8ec4025c31304a9dbebddfaaab82962f (patch)
treedf57e1594340f096a5221537ecbc5b560834745d /libavformat/utils.c
parentde1568a452d8348917fee533fe17517131dccf95 (diff)
lavf: avformat_seek_file(): validate stream_index.
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 5cf3d9cd47..a43238bd20 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2137,6 +2137,8 @@ int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int
{
if(min_ts > ts || max_ts < ts)
return -1;
+ if (stream_index < -1 || stream_index >= (int)s->nb_streams)
+ return AVERROR(EINVAL);
if(s->seek2any>0)
flags |= AVSEEK_FLAG_ANY;