Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
- index 9e076e89da..378c9ccac4 100644
- --- a/libavcodec/mpeg12dec.c
- +++ b/libavcodec/mpeg12dec.c
- @@ -1636,12 +1636,16 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
- memcpy(pan_scan->data, &s1->pan_scan, sizeof(s1->pan_scan));
- if (s1->a53_caption) {
- - AVFrameSideData *sd = av_frame_new_side_data(
- - s->current_picture_ptr->f, AV_FRAME_DATA_A53_CC,
- - s1->a53_caption_size);
- - if (sd)
- - memcpy(sd->data, s1->a53_caption, s1->a53_caption_size);
- - av_freep(&s1->a53_caption);
- + AVBufferRef *buf = av_buffer_create(s1->a53_caption, s1->a53_caption_size, NULL, NULL, 0);
- + if (buf) {
- + AVFrameSideData *sd = av_frame_new_side_data_from_buf(s->current_picture_ptr->f,
- + AV_FRAME_DATA_A53_CC, buf);
- + if (!sd)
- + av_buffer_unref(&buf);
- + } else
- + av_free(s1->a53_caption);
- + s1->a53_caption = NULL;
- + s1->a53_caption_size = 0;
- }
- if (s1->has_stereo3d) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement