summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorsongyutong <songyutong@kuaishou.com>2021-11-09 18:51:58 +0800
committerRick Kern <kernrj@gmail.com>2021-11-09 07:14:39 -0500
commit8a969e1280aa7aef31de6bd3db5ce46dc123fde0 (patch)
treee52bd2d2db933e94c6a50c14482f0c96a3128e16 /libavcodec
parenta13646639fcddb1de3bf08c25a243218cec39a0b (diff)
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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/videotoolboxenc.c1
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);