diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-15 03:41:20 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-19 07:45:48 +0100 |
commit | 54987a37daccbeec28d3f2ec58ff4d5656acd9b1 (patch) | |
tree | 70464b36363f2672a62a8412c53a4235f81df1d7 | |
parent | cfce16449cb815132f829d5a07beb138dfb2cba6 (diff) | |
download | ffmpeg-54987a37daccbeec28d3f2ec58ff4d5656acd9b1.tar.gz |
avformat/mpegenc: Fix leak in case trailer is never written
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r-- | libavformat/mpegenc.c | 5 |
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); } } |