OSDN Git Service

lavf/http: return error from seek on invalid whence
authorLukasz Marek <lukasz.m.luki@gmail.com>
Thu, 27 Feb 2014 23:36:07 +0000 (00:36 +0100)
committerLukasz Marek <lukasz.m.luki@gmail.com>
Wed, 5 Mar 2014 23:32:24 +0000 (00:32 +0100)
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
libavformat/http.c

index 08832bd..74e8162 100644 (file)
@@ -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;