ffmpeg | branch: master | Aman Gupta <a...@tmm1.net> | Tue Oct 18 16:44:33 2016 
-0700| [f45d5e07ddbdb1458cad8c42a3ed434cea5f148b] | committer: Rick Kern

lavc/videotoolboxenc: skip SEI allocation when side data is not present

Signed-off-by: Rick Kern <ker...@gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f45d5e07ddbdb1458cad8c42a3ed434cea5f148b
---

 libavcodec/videotoolboxenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 9a69c28..cb9e2fe 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");

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to