[FFmpeg-cvslog] lavf/mux: Always call write_trailer() from av_write_trailer() to avoid a leak.
Carl Eugen Hoyos
git at videolan.org
Thu Nov 20 12:10:26 CET 2014
ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Thu Nov 20 10:14:51 2014 +0100| [25ccf5df723c4e933f8cc25f36ba21264ef59a8c] | committer: Carl Eugen Hoyos
lavf/mux: Always call write_trailer() from av_write_trailer() to avoid a leak.
Fixes ticket #4049.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=25ccf5df723c4e933f8cc25f36ba21264ef59a8c
---
libavformat/mux.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/libavformat/mux.c b/libavformat/mux.c
index a09e33c..023832c 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -926,7 +926,7 @@ int av_write_trailer(AVFormatContext *s)
for (;; ) {
AVPacket pkt;
ret = interleave_packet(s, &pkt, NULL, 1);
- if (ret < 0) //FIXME cleanup needed for ret<0 ?
+ if (ret < 0)
goto fail;
if (!ret)
break;
@@ -943,10 +943,14 @@ int av_write_trailer(AVFormatContext *s)
goto fail;
}
+fail:
if (s->oformat->write_trailer)
+ if (ret >= 0) {
ret = s->oformat->write_trailer(s);
+ } else {
+ s->oformat->write_trailer(s);
+ }
-fail:
if (s->pb)
avio_flush(s->pb);
if (ret == 0)
More information about the ffmpeg-cvslog
mailing list