Commit 12461b43d5 for ffmpeg
commit 12461b43d5d841a44fc02ae3d304d967a4406973
Author: Leo Bicknell <bicknell@ufp.org>
Date: Thu Oct 1 18:23:03 2026 -0400
avcodec/videotoolboxenc: fix leak when constant bitrate is not supported
The CFNumber holding the bitrate was not released when the encoder
rejected kVTCompressionPropertyKey_ConstantBitRate.
Signed-off-by: Leo Bicknell <bicknell@ufp.org>
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index aa5e4313b9..7dc8c2ac75 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -1267,6 +1267,7 @@ static int vtenc_create_encoder(AVCodecContext *avctx,
bit_rate_num);
if (status == kVTPropertyNotSupportedErr) {
av_log(avctx, AV_LOG_ERROR, "-constant_bit_rate true is not supported by the encoder.\n");
+ CFRelease(bit_rate_num);
return AVERROR_EXTERNAL;
}
} else {