From f316762a2a747ce2b43ca252530c0995324479dd Mon Sep 17 00:00:00 2001 From: wangshaohui Date: Fri, 19 Mar 2021 14:33:59 +0800 Subject: [PATCH] win-dshow: Fix memory leak caused by using incorrect API --- plugins/win-dshow/ffmpeg-decode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/win-dshow/ffmpeg-decode.c b/plugins/win-dshow/ffmpeg-decode.c index 7c4165d8a..76cc1a7c9 100644 --- a/plugins/win-dshow/ffmpeg-decode.c +++ b/plugins/win-dshow/ffmpeg-decode.c @@ -107,7 +107,7 @@ int ffmpeg_decode_init(struct ffmpeg_decode *decode, enum AVCodecID id, void ffmpeg_decode_free(struct ffmpeg_decode *decode) { if (decode->hw_frame) - av_free(decode->hw_frame); + av_frame_free(&decode->hw_frame); if (decode->decoder) { avcodec_close(decode->decoder); @@ -115,7 +115,7 @@ void ffmpeg_decode_free(struct ffmpeg_decode *decode) } if (decode->frame) - av_free(decode->frame); + av_frame_free(&decode->frame); if (decode->packet_buffer) bfree(decode->packet_buffer);