git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c661601
)
lavf/mux: Always call write_trailer() from av_write_trailer() to avoid a leak.
author
Carl Eugen Hoyos
<cehoyos@ag.or.at>
Thu, 20 Nov 2014 09:14:51 +0000
(10:14 +0100)
committer
Carl Eugen Hoyos
<cehoyos@ag.or.at>
Thu, 20 Nov 2014 09:14:51 +0000
(10:14 +0100)
Fixes ticket #4049.
libavformat/mux.c
patch
|
blob
|
history
diff --git
a/libavformat/mux.c
b/libavformat/mux.c
index
a09e33c
..
023832c
100644
(file)
--- 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)