]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/dnxhdenc: return error if av_malloc failed
authorLimin Wang <lance.lmwang@gmail.com>
Mon, 23 Sep 2019 03:36:18 +0000 (11:36 +0800)
committerJames Almer <jamrial@gmail.com>
Wed, 25 Sep 2019 20:56:44 +0000 (17:56 -0300)
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/dnxhdenc.c

index 41b8079a09ca9ba6176b4e2df0db48318d84c0ee..c82c5d51403c6c3a1670a727e91f4f0ccb5b109a 100644 (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));
         }
     }