win-dshow: Fix memory leak caused by using incorrect API

master
wangshaohui 2021-03-19 14:33:59 +08:00 committed by Jim
parent 535e7dfa15
commit f316762a2a
1 changed files with 2 additions and 2 deletions

View File

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