summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2016-10-18 16:44:33 -0700
committerRick Kern <kernrj@gmail.com>2016-10-18 19:51:42 -0400
commitf45d5e07ddbdb1458cad8c42a3ed434cea5f148b (patch)
tree93f459002868c6cf0a214513211703b5ee9518be /libavcodec
parent47ee6f1a59b1f345f4f9d8e79c30d66df12b72e7 (diff)
lavc/videotoolboxenc: skip SEI allocation when side data is not present
Signed-off-by: Rick Kern <kernrj@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/videotoolboxenc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 9a69c2831f..cb9e2fe6e8 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -2019,6 +2019,7 @@ static int vtenc_send_frame(AVCodecContext *avctx,
CMTime time;
CFDictionaryRef frame_dict;
CVPixelBufferRef cv_img = NULL;
+ AVFrameSideData *side_data = NULL;
ExtraSEI *sei = NULL;
int status = create_cv_pixel_buffer(avctx, frame, &cv_img);
@@ -2030,7 +2031,8 @@ static int vtenc_send_frame(AVCodecContext *avctx,
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));
if (!sei) {
av_log(avctx, AV_LOG_ERROR, "Not enough memory for closed captions, skipping\n");