shithub: dav1d

Download patch

ref: 60cc1b8b9eab94545d9a41dca25b123da924442b
parent: 9caf90425b741d80ad46ff0eb84fda79fc3990e6
author: Derek Buitenhuis <derek.buitenhuis@gmail.com>
date: Tue Oct 2 09:26:13 EDT 2018

lib: Fix unchecked malloc

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>

--- a/src/lib.c
+++ b/src/lib.c
@@ -86,6 +86,7 @@
     if (c->n_fc > 1) {
         c->frame_thread.out_delayed =
             malloc(sizeof(*c->frame_thread.out_delayed) * c->n_fc);
+        if (!c->frame_thread.out_delayed) goto error;
         memset(c->frame_thread.out_delayed, 0,
                sizeof(*c->frame_thread.out_delayed) * c->n_fc);
     }