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>
This commit is contained in:
songyutong 2021-11-09 18:51:58 +08:00 committed by Rick Kern
parent a13646639f
commit 8a969e1280
1 changed files with 1 additions and 0 deletions

View File

@ -2554,6 +2554,7 @@ static int vtenc_populate_extradata(AVCodecContext *avctx,
pe_cleanup: pe_cleanup:
CVPixelBufferRelease(pix_buf);
if(vtctx->session) if(vtctx->session)
CFRelease(vtctx->session); CFRelease(vtctx->session);