summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhdenc.c
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2019-09-23 11:36:18 +0800
committerJames Almer <jamrial@gmail.com>2019-09-25 17:56:44 -0300
commit3def984a98c3f374db974606013892f71c406af9 (patch)
treee6976aba000d35bd52a817d9f58e692b697d67ee /libavcodec/dnxhdenc.c
parentced3b8c61e969cab511d4418e47353f347af04d5 (diff)
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>
Diffstat (limited to 'libavcodec/dnxhdenc.c')
-rw-r--r--libavcodec/dnxhdenc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 41b8079a09..c82c5d5140 100644
--- a/libavcodec/dnxhdenc.c
+++ b/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));
}
}