mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-24 17:12:34 +02:00
lavc/videotoolboxenc: Fix crash by uninitialized value
If create_cv_pixel_buffer() fails, pixel_buffer_info might get into CFRelease() containing an arbitrary value.
This commit is contained in:
parent
5a7978a694
commit
2ca2d46f0b
@ -1440,7 +1440,7 @@ static int vtenc_create_encoder(AVCodecContext *avctx,
|
|||||||
static int vtenc_configure_encoder(AVCodecContext *avctx)
|
static int vtenc_configure_encoder(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
CFMutableDictionaryRef enc_info;
|
CFMutableDictionaryRef enc_info;
|
||||||
CFMutableDictionaryRef pixel_buffer_info;
|
CFMutableDictionaryRef pixel_buffer_info = NULL;
|
||||||
CMVideoCodecType codec_type;
|
CMVideoCodecType codec_type;
|
||||||
VTEncContext *vtctx = avctx->priv_data;
|
VTEncContext *vtctx = avctx->priv_data;
|
||||||
CFStringRef profile_level = NULL;
|
CFStringRef profile_level = NULL;
|
||||||
@ -1517,8 +1517,6 @@ static int vtenc_configure_encoder(AVCodecContext *avctx)
|
|||||||
status = create_cv_pixel_buffer_info(avctx, &pixel_buffer_info);
|
status = create_cv_pixel_buffer_info(avctx, &pixel_buffer_info);
|
||||||
if (status)
|
if (status)
|
||||||
goto init_cleanup;
|
goto init_cleanup;
|
||||||
} else {
|
|
||||||
pixel_buffer_info = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vtctx->dts_delta = vtctx->has_b_frames ? -1 : 0;
|
vtctx->dts_delta = vtctx->has_b_frames ? -1 : 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user