mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-02 04:43:27 +00:00
avcodec/dnxhdenc: Use av_memdup() instead of av_malloc()+memcpy()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
eb583b3cb9
commit
3c1208be02
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user