Commit 9caf9042 authored by Derek Buitenhuis's avatar Derek Buitenhuis
Browse files

ref_mvs: Check for alloation fail before calling memset in av1_alloc_ref_mv_common


Signed-off-by: Derek Buitenhuis's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
parent 1add94bf
...@@ -121,6 +121,7 @@ int dav1d_open(Dav1dContext **const c_out, ...@@ -121,6 +121,7 @@ int dav1d_open(Dav1dContext **const c_out,
} }
} }
f->libaom_cm = av1_alloc_ref_mv_common(); f->libaom_cm = av1_alloc_ref_mv_common();
if (!f->libaom_cm) goto error;
if (c->n_fc > 1) { if (c->n_fc > 1) {
pthread_mutex_init(&f->frame_thread.td.lock, NULL); pthread_mutex_init(&f->frame_thread.td.lock, NULL);
pthread_cond_init(&f->frame_thread.td.cond, NULL); pthread_cond_init(&f->frame_thread.td.cond, NULL);
......
...@@ -3540,6 +3540,7 @@ void av1_init_ref_mv_tile_row(AV1_COMMON *cm, ...@@ -3540,6 +3540,7 @@ void av1_init_ref_mv_tile_row(AV1_COMMON *cm,
AV1_COMMON *av1_alloc_ref_mv_common(void) { AV1_COMMON *av1_alloc_ref_mv_common(void) {
AV1_COMMON *cm = malloc(sizeof(*cm)); AV1_COMMON *cm = malloc(sizeof(*cm));
if (!cm) return NULL;
memset(cm, 0, sizeof(*cm)); memset(cm, 0, sizeof(*cm));
return cm; return cm;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment