From 3388bcced450bfc8e6aff17f57184f29fd4a3383 Mon Sep 17 00:00:00 2001 From: "Reynaldo H. Verdejo Pinochet" Date: Sun, 4 Oct 2015 14:08:57 -0700 Subject: [PATCH] ffserver: unify exit path in _write_index() Signed-off-by: Reynaldo H. Verdejo Pinochet --- ffserver.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ffserver.c b/ffserver.c index 032ce227da..e3c3b420a2 100644 --- a/ffserver.c +++ b/ffserver.c @@ -287,10 +287,14 @@ static int ffm_write_write_index(int fd, int64_t pos) for(i=0;i<8;i++) buf[i] = (pos >> (56 - i * 8)) & 0xff; if (lseek(fd, 8, SEEK_SET) < 0) - return AVERROR(EIO); + goto bail_eio; if (write(fd, buf, 8) != 8) - return AVERROR(EIO); + goto bail_eio; + return 8; + +bail_eio: + return AVERROR(EIO); } static void ffm_set_write_index(AVFormatContext *s, int64_t pos,