aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-15 03:41:20 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 07:20:59 +0100
commitd711b5698544a6a23f185c085621b8f7fe99800a (patch)
tree52193b62bfc3bff0d58e4468b697deacf5cc2e17 /libavformat
parent0685bd0245a9682adee9c7c162e3c32f2ddf44cb (diff)
downloadffmpeg-d711b5698544a6a23f185c085621b8f7fe99800a.tar.gz
avformat/mpegenc: Fix leak in case trailer is never written
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit 54987a37daccbeec28d3f2ec58ff4d5656acd9b1)
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mpegenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 810dd717ca..1204e57f04 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -1262,6 +1262,11 @@ static void mpeg_mux_deinit(AVFormatContext *ctx)
StreamInfo *stream = ctx->streams[i]->priv_data;
if (!stream)
continue;
+ for (PacketDesc *pkt = stream->predecode_packet; pkt; ) {
+ PacketDesc *tmp = pkt->next;
+ av_free(pkt);
+ pkt = tmp;
+ }
av_fifo_freep(&stream->fifo);
}
}