aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhao Zhili <zhilizhao@tencent.com>2024-08-24 01:09:56 +0800
committerZhao Zhili <zhilizhao@tencent.com>2024-08-26 17:09:46 +0800
commit12cdb30e37af8beb536f49b76bafd5fedb5b850c (patch)
tree6d0d76b189446ee7c9475f29d91cd7454e7b51ad
parent420d4436005a298983268c71e926079dbf4e1897 (diff)
downloadffmpeg-12cdb30e37af8beb536f49b76bafd5fedb5b850c.tar.gz
avcodec/videotoolboxenc: Fix leaking of supported_props
There are two VTCompressionSessionRef been created, one for generating extradata, and another for normal encoding. supported_props was been overwritten without release. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
-rw-r--r--libavcodec/videotoolboxenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 78ef474d7a..f4070571d3 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -1205,6 +1205,10 @@ static int vtenc_create_encoder(AVCodecContext *avctx,
#if defined (MAC_OS_X_VERSION_10_13) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_13)
if (__builtin_available(macOS 10.13, *)) {
+ if (vtctx->supported_props) {
+ CFRelease(vtctx->supported_props);
+ vtctx->supported_props = NULL;
+ }
status = VTCopySupportedPropertyDictionaryForEncoder(avctx->width,
avctx->height,
codec_type,