Guest User

Untitled

a guest
Aug 17th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.08 KB | None | 0 0
  1. diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
  2. index ede9a1a6ea..ade874b70e 100644
  3. --- a/libavcodec/h264_slice.c
  4. +++ b/libavcodec/h264_slice.c
  5. @@ -1269,15 +1269,14 @@ static int h264_export_frame_props(H264Context *h)
  6.          }
  7.      }
  8.  
  9. -    if (h->sei.a53_caption.a53_caption) {
  10. +    if (h->sei.a53_caption.buf_ref) {
  11.          H264SEIA53Caption *a53 = &h->sei.a53_caption;
  12. -        AVFrameSideData *sd = av_frame_new_side_data(cur->f,
  13. +        AVFrameSideData *sd = av_frame_new_side_data_from_buf(cur->f,
  14.                                                       AV_FRAME_DATA_A53_CC,
  15. -                                                     a53->a53_caption_size);
  16. -        if (sd)
  17. -            memcpy(sd->data, a53->a53_caption, a53->a53_caption_size);
  18. -        av_freep(&a53->a53_caption);
  19. -        a53->a53_caption_size = 0;
  20. +                                                     a53->buf_ref);
  21. +        if (!sd) {
  22. +            av_buffer_unref(&a53->buf_ref);
  23. +        a53->buf_ref = NULL;
  24.          h->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS;
  25.      }
Advertisement
Add Comment
Please, Sign In to add comment