summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-06 02:01:38 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-10 22:12:02 +0200
commit3c1208be0201785e7e9786aecd40916f9396f8cc (patch)
tree85d0c26466330488d6b1e57a53d792fb63ff24f1
parenteb583b3cb98797e8e815b7432f90cae8e8d52794 (diff)
avcodec/dnxhdenc: Use av_memdup() instead of av_malloc()+memcpy()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/dnxhdenc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 1df5346e62..1a59815472 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -516,10 +516,9 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
ctx->thread[0] = ctx;
if (avctx->active_thread_type == FF_THREAD_SLICE) {
for (i = 1; i < avctx->thread_count; i++) {
- ctx->thread[i] = av_malloc(sizeof(DNXHDEncContext));
+ ctx->thread[i] = av_memdup(ctx, sizeof(DNXHDEncContext));
if (!ctx->thread[i])
return AVERROR(ENOMEM);
- memcpy(ctx->thread[i], ctx, sizeof(DNXHDEncContext));
}
}