mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 03:39:45 +00:00
lavf/mux: Always call write_trailer() from av_write_trailer() to avoid a leak.
Fixes ticket #4049.
This commit is contained in:
parent
c661601f45
commit
25ccf5df72
@ -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;
|
||||
}
|
||||
|
||||
if (s->oformat->write_trailer)
|
||||
ret = s->oformat->write_trailer(s);
|
||||
|
||||
fail:
|
||||
if (s->oformat->write_trailer)
|
||||
if (ret >= 0) {
|
||||
ret = s->oformat->write_trailer(s);
|
||||
} else {
|
||||
s->oformat->write_trailer(s);
|
||||
}
|
||||
|
||||
if (s->pb)
|
||||
avio_flush(s->pb);
|
||||
if (ret == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user