ffmpeg | branch: release/2.2 | Michael Niedermayer <michae...@gmx.at> | Sun Dec 
14 17:26:11 2014 +0100| [f2fde86dae21f55a69a959e61e3d6466a6d5d545] | committer: 
Michael Niedermayer

avformat/aviobuf: Check that avio_seek() target is non negative

Fixes out of array access

Suggested-by: Andrew Scherkus <scher...@google.com>
Signed-off-by: Michael Niedermayer <michae...@gmx.at>
(cherry picked from commit ed86dbd05d61363dc1c0d33f3267e2177c985fdd)

Signed-off-by: Michael Niedermayer <michae...@gmx.at>

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

 libavformat/aviobuf.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 95fdf20..db5a0f3 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -219,6 +219,9 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int 
whence)
             return offset1;
         offset += offset1;
     }
+    if (offset < 0)
+        return AVERROR(EINVAL);
+
     offset1 = offset - pos;
     if (!s->must_flush && (!s->direct || !s->seek) &&
         offset1 >= 0 && offset1 <= buffer_size) {

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to