aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorSean McGovern <gseanmcg@gmail.com>2015-08-27 00:04:16 -0400
committerLuca Barbato <lu_zero@gentoo.org>2015-09-03 13:39:34 +0200
commit9ad1e0c12caa440de860bd8f2122beb11d73815c (patch)
treeb5b67707e06cb6c9e90838319cb340b6564403ac /libavformat/mux.c
parente05f7ed5436207f4a55f1978b223c7f8bc82af42 (diff)
downloadffmpeg-9ad1e0c12caa440de860bd8f2122beb11d73815c.tar.gz
mux: Make sure that the data is actually written
And forward the error if it is not. Bug-Id: 881 CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 7959edf72c..4bba970c92 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -352,8 +352,12 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
}
ret = s->oformat->write_packet(s, pkt);
- if (s->pb && ret >= 0 && s->flags & AVFMT_FLAG_FLUSH_PACKETS)
- avio_flush(s->pb);
+ if (s->pb && ret >= 0) {
+ if (s->flags & AVFMT_FLAG_FLUSH_PACKETS)
+ avio_flush(s->pb);
+ if (s->pb->error < 0)
+ ret = s->pb->error;
+ }
return ret;
}