Skip to content

Commit

Permalink
avformat/mpegenc: Fix leak in case trailer is never written
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Rheinhardt <[email protected]>
  • Loading branch information
mkver committed Feb 19, 2021
1 parent cfce164 commit 54987a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libavformat/mpegenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 54987a3

Please sign in to comment.