[FFmpeg-cvslog] libavformat: Allow calling av_write_trailer with a NULL AVIOContext

Martin Storsjö git at videolan.org
Sat Dec 20 00:32:55 CET 2014


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Fri Dec 19 15:40:02 2014 +0200| [4895aa65c6ddec2e33ec3c023f221b1bafcbaf9f] | committer: Martin Storsjö

libavformat: Allow calling av_write_trailer with a NULL AVIOContext

Signed-off-by: Martin Storsjö <martin at martin.st>

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

 libavformat/mux.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index 9aee224..2a28fd6 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:



More information about the ffmpeg-cvslog mailing list