[FFmpeg-cvslog] cache: check lseek() return

Michael Niedermayer git at videolan.org
Thu Oct 18 01:14:04 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Oct 18 00:55:03 2012 +0200| [eb19d89d8eb51f20299d59558d69d0f057583e7c] | committer: Michael Niedermayer

cache: check lseek() return

Fixes CID717496
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/cache.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/cache.c b/libavformat/cache.c
index 2cfc396..35f81e8 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);
     }
 }



More information about the ffmpeg-cvslog mailing list