[FFmpeg-cvslog] lavf/libssh: fix seek to nagative position

Lukasz Marek git at videolan.org
Fri Feb 28 02:25:59 CET 2014


ffmpeg | branch: master | Lukasz Marek <lukasz.m.luki at gmail.com> | Fri Feb 28 00:04:29 2014 +0100| [0025f130059dedea3dcae7bc38fdf46c40097f4c] | committer: Lukasz Marek

lavf/libssh: fix seek to nagative position

Signed-off-by: Lukasz Marek <lukasz.m.luki at gmail.com>

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

 libavformat/libssh.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/libssh.c b/libavformat/libssh.c
index 418b100..b20e93b 100644
--- a/libavformat/libssh.c
+++ b/libavformat/libssh.c
@@ -243,6 +243,11 @@ static int64_t libssh_seek(URLContext *h, int64_t pos, int whence)
         return AVERROR(EINVAL);
     }
 
+    if (newpos < 0) {
+        av_log(h, AV_LOG_ERROR, "Seeking to nagative position.\n");
+        return AVERROR(EINVAL);
+    }
+
     if (sftp_seek64(libssh->file, newpos)) {
         av_log(h, AV_LOG_ERROR, "Error during seeking.\n");
         return AVERROR(EIO);



More information about the ffmpeg-cvslog mailing list