mirror of https://git.ffmpeg.org/ffmpeg.git
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:
parent
ced3b8c61e
commit
3def984a98
|
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue