aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-20 11:41:27 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-20 11:41:30 +0100
commit9266eb0c620ddc555f9bbc422c31c84bcba6d549 (patch)
tree93e8abb9cf95829070fd71aa9100e384c36b26a9 /libavformat/mux.c
parent29d208d5d47b0aafe9460ab035afaf2fcd5e8f6b (diff)
parent25ccf5df723c4e933f8cc25f36ba21264ef59a8c (diff)
downloadffmpeg-9266eb0c620ddc555f9bbc422c31c84bcba6d549.tar.gz
Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master: lavf/mux: Always call write_trailer() from av_write_trailer() to avoid a leak. Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 a09e33cfdd..023832c336 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)