summaryrefslogtreecommitdiff
path: root/libavformat/mux.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 9aee224d1f..2a28fd668a 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -624,7 +624,7 @@ int av_write_trailer(AVFormatContext *s)
if (s->oformat->write_trailer)
ret = s->oformat->write_trailer(s);
- if (!(s->oformat->flags & AVFMT_NOFILE))
+ if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
avio_flush(s->pb);
fail: