lavf/http: return error from seek on invalid whence

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
This commit is contained in:
Lukasz Marek 2014-02-28 00:36:07 +01:00
parent 4ba6a534dc
commit 1aa262f460
1 changed files with 2 additions and 0 deletions

View 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;