From eb19d89d8eb51f20299d59558d69d0f057583e7c Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 18 Oct 2012 00:55:03 +0200 Subject: [PATCH] cache: check lseek() return Fixes CID717496 Signed-off-by: Michael Niedermayer --- libavformat/cache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/cache.c b/libavformat/cache.c index 2cfc396f29..35f81e83c1 100644 --- a/libavformat/cache.c +++ b/libavformat/cache.c @@ -114,7 +114,9 @@ static int64_t cache_seek(URLContext *h, int64_t pos, int whence) c->pos= pos; return pos; }else{ - lseek(c->fd, c->pos, SEEK_SET); + if(lseek(c->fd, c->pos, SEEK_SET) < 0) { + av_log(h, AV_LOG_ERROR, "Failure to seek in cache\n"); + } return AVERROR(EPIPE); } }