From 378a5b9c5f1a8b51dee3b954713d18f330fbb027 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 17 Oct 2012 20:23:16 +0200 Subject: [PATCH] ffm_write_write_index: check lseek() return code Fixes CID732185 Signed-off-by: Michael Niedermayer --- ffserver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ffserver.c b/ffserver.c index f98ee821bb..bab40a3275 100644 --- a/ffserver.c +++ b/ffserver.c @@ -346,7 +346,8 @@ static int ffm_write_write_index(int fd, int64_t pos) for(i=0;i<8;i++) buf[i] = (pos >> (56 - i * 8)) & 0xff; - lseek(fd, 8, SEEK_SET); + if (lseek(fd, 8, SEEK_SET) < 0) + return AVERROR(EIO); if (write(fd, buf, 8) != 8) return AVERROR(EIO); return 8;