avcodec/dnxhdenc: return error if av_malloc failed

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Limin Wang 2019-09-23 11:36:18 +08:00 committed by James Almer
parent ced3b8c61e
commit 3def984a98

View File

@ -542,6 +542,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (avctx->active_thread_type == FF_THREAD_SLICE) {
for (i = 1; i < avctx->thread_count; i++) {
ctx->thread[i] = av_malloc(sizeof(DNXHDEncContext));
if (!ctx->thread[i])
goto fail;
memcpy(ctx->thread[i], ctx, sizeof(DNXHDEncContext));
}
}