avformat/mpegenc: Fix leak in case trailer is never written

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2021-02-15 03:41:20 +01:00
parent cfce16449c
commit 54987a37da
1 changed files with 5 additions and 0 deletions

View File

@ -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);
}
}