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>
pull/323/head
Limin Wang 6 years ago committed by James Almer
parent ced3b8c61e
commit 3def984a98
  1. 2
      libavcodec/dnxhdenc.c

@ -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));
}
}

Loading…
Cancel
Save