[FFmpeg-devel] [PATCH 2/2] lavf/http: return error from seek on invalid whence

Lukasz Marek lukasz.m.luki at gmail.com
Fri Feb 28 00:36:07 CET 2014


Signed-off-by: Lukasz Marek <lukasz.m.luki at gmail.com>
---
 libavformat/http.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/http.c b/libavformat/http.c
index 08832bd..74e8162 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -959,6 +959,8 @@ static int64_t http_seek(URLContext *h, int64_t off, int whence)
         off += s->off;
     else if (whence == SEEK_END)
         off += s->filesize;
+    else if (whence != SEEK_SET)
+        return AVERROR(EINVAL);
     if (off < 0)
         return AVERROR(EINVAL);
     s->off = off;
-- 
1.8.3.2



More information about the ffmpeg-devel mailing list