mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
lavc/videotoolboxenc: Handle out-of-memory and fix memory leak
Signed-off-by: Rick Kern <kernrj@gmail.com>
This commit is contained in:
parent
2fbf39382d
commit
272dd437bc
@ -706,9 +706,14 @@ static av_cold int vtenc_init(AVCodecContext *avctx)
|
||||
CFNumberRef interval = CFNumberCreate(kCFAllocatorDefault,
|
||||
kCFNumberIntType,
|
||||
&avctx->gop_size);
|
||||
if (!interval) {
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
status = VTSessionSetProperty(vtctx->session,
|
||||
kVTCompressionPropertyKey_MaxKeyFrameInterval,
|
||||
interval);
|
||||
CFRelease(interval);
|
||||
|
||||
if (status) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error setting 'max key-frame interval' property: %d\n", status);
|
||||
|
Loading…
x
Reference in New Issue
Block a user