[FFmpeg-cvslog] lavf: avformat_seek_file(): validate stream_index.

Nicolas George git at videolan.org
Wed Mar 20 14:03:17 CET 2013


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Wed Mar 20 12:27:42 2013 +0100| [0d09aa9d8ec4025c31304a9dbebddfaaab82962f] | committer: Nicolas George

lavf: avformat_seek_file(): validate stream_index.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0d09aa9d8ec4025c31304a9dbebddfaaab82962f
---

 libavformat/utils.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 5cf3d9c..a43238b 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;



More information about the ffmpeg-cvslog mailing list