[FFmpeg-cvslog] avcodec/videotoolboxenc: fix pixel buffer memory leak

songyutong git at videolan.org
Tue Nov 9 14:19:14 EET 2021


ffmpeg | branch: master | songyutong <songyutong at kuaishou.com> | Tue Nov  9 18:51:58 2021 +0800| [8a969e1280aa7aef31de6bd3db5ce46dc123fde0] | committer: Rick Kern

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 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a969e1280aa7aef31de6bd3db5ce46dc123fde0
---

 libavcodec/videotoolboxenc.c | 1 +
 1 file changed, 1 insertion(+)

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



More information about the ffmpeg-cvslog mailing list