aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2020-09-17 10:34:08 -0300
committerJames Almer <jamrial@gmail.com>2020-09-23 10:21:33 -0300
commit449984445ea41e8979470577f47ca0477192258c (patch)
treee19a10037958d5c4955c931f237dc8558a15e562 /libavcodec
parentbd4ef145c0c1a1f699fd4d9939dba4d7a338a2cf (diff)
downloadffmpeg-449984445ea41e8979470577f47ca0477192258c.tar.gz
avcodec/hevcdec: sync User Data Unregistered SEI buffers across threads
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/hevcdec.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 1f3ea54d39..5bfde10d43 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -3548,6 +3548,25 @@ static int hevc_update_thread_context(AVCodecContext *dst,
return AVERROR(ENOMEM);
}
+ for (i = 0; i < s->sei.unregistered.nb_buf_ref; i++)
+ av_buffer_unref(&s->sei.unregistered.buf_ref[i]);
+ s->sei.unregistered.nb_buf_ref = 0;
+
+ if (s0->sei.unregistered.nb_buf_ref) {
+ ret = av_reallocp_array(&s->sei.unregistered.buf_ref,
+ s0->sei.unregistered.nb_buf_ref,
+ sizeof(*s->sei.unregistered.buf_ref));
+ if (ret < 0)
+ return ret;
+
+ for (i = 0; i < s0->sei.unregistered.nb_buf_ref; i++) {
+ s->sei.unregistered.buf_ref[i] = av_buffer_ref(s0->sei.unregistered.buf_ref[i]);
+ if (!s->sei.unregistered.buf_ref[i])
+ return AVERROR(ENOMEM);
+ s->sei.unregistered.nb_buf_ref++;
+ }
+ }
+
s->sei.frame_packing = s0->sei.frame_packing;
s->sei.display_orientation = s0->sei.display_orientation;
s->sei.mastering_display = s0->sei.mastering_display;