Commit 3def984a authored by Limin Wang's avatar Limin Wang Committed by James Almer

avcodec/dnxhdenc: return error if av_malloc failed

Signed-off-by: 's avatarLimin Wang <lance.lmwang@gmail.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent ced3b8c6
...@@ -542,6 +542,8 @@ FF_ENABLE_DEPRECATION_WARNINGS ...@@ -542,6 +542,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (avctx->active_thread_type == FF_THREAD_SLICE) { if (avctx->active_thread_type == FF_THREAD_SLICE) {
for (i = 1; i < avctx->thread_count; i++) { for (i = 1; i < avctx->thread_count; i++) {
ctx->thread[i] = av_malloc(sizeof(DNXHDEncContext)); ctx->thread[i] = av_malloc(sizeof(DNXHDEncContext));
if (!ctx->thread[i])
goto fail;
memcpy(ctx->thread[i], ctx, sizeof(DNXHDEncContext)); memcpy(ctx->thread[i], ctx, sizeof(DNXHDEncContext));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment