From: Jun Zhao <barryjz...@tencent.com> Fix memory leak after write trailer for #7827
Signed-off-by: Jun Zhao <barryjz...@tencent.com> --- libavformat/matroskaenc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index b9f99c4..22ba93a 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -2571,13 +2571,13 @@ static int mkv_write_trailer(AVFormatContext *s) // check if we have an audio packet cached if (mkv->cur_audio_pkt.size > 0) { ret = mkv_write_packet_internal(s, &mkv->cur_audio_pkt, 0); - av_packet_unref(&mkv->cur_audio_pkt); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Could not write cached audio packet ret:%d\n", ret); return ret; } } + av_packet_unref(&mkv->cur_audio_pkt); if (mkv->dyn_bc) { end_ebml_master_crc32(pb, &mkv->dyn_bc, mkv, mkv->cluster); -- 1.7.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".