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>
pull/374/head
songyutong 3 years ago committed by Rick Kern
parent a13646639f
commit 8a969e1280
  1. 1
      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);

Loading…
Cancel
Save