diff options
author | songyutong <songyutong@kuaishou.com> | 2021-11-09 18:51:58 +0800 |
---|---|---|
committer | Rick Kern <kernrj@gmail.com> | 2021-11-09 07:14:39 -0500 |
commit | 8a969e1280aa7aef31de6bd3db5ce46dc123fde0 (patch) | |
tree | e52bd2d2db933e94c6a50c14482f0c96a3128e16 | |
parent | a13646639fcddb1de3bf08c25a243218cec39a0b (diff) | |
download | ffmpeg-8a969e1280aa7aef31de6bd3db5ce46dc123fde0.tar.gz |
avcodec/videotoolboxenc: fix pixel buffer memory leak
In function vtenc_populate_extradata(), there is a manually created
pixel buffer that has not been released. So we should use CVPixelBufferRelease
to release this pixel buffer at the end, otherwise will cause a memory leak.
Signed-off-by: Rick Kern <kernrj@gmail.com>
-rw-r--r-- | libavcodec/videotoolboxenc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index bac36fda90..ebaa3ebdc8 100644 --- a/libavcodec/videotoolboxenc.c +++ b/libavcodec/videotoolboxenc.c @@ -2554,6 +2554,7 @@ static int vtenc_populate_extradata(AVCodecContext *avctx, pe_cleanup: + CVPixelBufferRelease(pix_buf); if(vtctx->session) CFRelease(vtctx->session); |