You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-16 22:42:38 +02:00
lavc/videotoolboxenc: skip SEI allocation when side data is not present
Signed-off-by: Rick Kern <kernrj@gmail.com>
This commit is contained in:
@ -2019,6 +2019,7 @@ static int vtenc_send_frame(AVCodecContext *avctx,
|
|||||||
CMTime time;
|
CMTime time;
|
||||||
CFDictionaryRef frame_dict;
|
CFDictionaryRef frame_dict;
|
||||||
CVPixelBufferRef cv_img = NULL;
|
CVPixelBufferRef cv_img = NULL;
|
||||||
|
AVFrameSideData *side_data = NULL;
|
||||||
ExtraSEI *sei = NULL;
|
ExtraSEI *sei = NULL;
|
||||||
int status = create_cv_pixel_buffer(avctx, frame, &cv_img);
|
int status = create_cv_pixel_buffer(avctx, frame, &cv_img);
|
||||||
|
|
||||||
@ -2030,7 +2031,8 @@ static int vtenc_send_frame(AVCodecContext *avctx,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vtctx->a53_cc) {
|
side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_A53_CC);
|
||||||
|
if (vtctx->a53_cc && side_data && side_data->size) {
|
||||||
sei = av_mallocz(sizeof(*sei));
|
sei = av_mallocz(sizeof(*sei));
|
||||||
if (!sei) {
|
if (!sei) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Not enough memory for closed captions, skipping\n");
|
av_log(avctx, AV_LOG_ERROR, "Not enough memory for closed captions, skipping\n");
|
||||||
|
Reference in New Issue
Block a user