aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-10-11 16:15:24 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-11-07 17:38:22 +0100
commit7c5ee237bebbaaac6a2734d1919c005ca9684055 (patch)
treeeb3ba3e3d803b0a82cf804bb45623769f3ac6dee
parent31d0487ba23a59cdebb1ce64253b3b05000ad0f3 (diff)
downloadffmpeg-7c5ee237bebbaaac6a2734d1919c005ca9684055.tar.gz
avcodec/libdav1d: Use av_memdup() where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/libdav1d.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 507aaa1a96..bbc81a9dc9 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -319,13 +319,13 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
av_packet_unref(pkt);
if (c->reordered_opaque != AV_NOPTS_VALUE) {
- uint8_t *reordered_opaque = av_malloc(sizeof(c->reordered_opaque));
+ uint8_t *reordered_opaque = av_memdup(&c->reordered_opaque,
+ sizeof(c->reordered_opaque));
if (!reordered_opaque) {
dav1d_data_unref(data);
return AVERROR(ENOMEM);
}
- memcpy(reordered_opaque, &c->reordered_opaque, sizeof(c->reordered_opaque));
res = dav1d_data_wrap_user_data(data, reordered_opaque,
libdav1d_user_data_free, reordered_opaque);
if (res < 0) {