Commit dab08ce4 authored by Ronald S. Bultje's avatar Ronald S. Bultje

Use negative return value in case of segmentation setup errors

parent d06e0d6d
......@@ -3052,7 +3052,10 @@ int dav1d_submit_frame(Dav1dContext *const c) {
const int ref_h = (f->refp[pri_ref].p.p.h + 3) >> 2;
if (ref_w == f->bw && ref_h == f->bh) {
f->prev_segmap_ref = c->refs[f->frame_hdr.refidx[pri_ref]].segmap;
if (f->prev_segmap_ref == NULL) goto error;
if (f->prev_segmap_ref == NULL) {
res = -EINVAL;
goto error;
}
dav1d_ref_inc(f->prev_segmap_ref);
f->prev_segmap = f->prev_segmap_ref->data;
} else {
......@@ -3071,6 +3074,7 @@ int dav1d_submit_frame(Dav1dContext *const c) {
dav1d_ref_inc(f->cur_segmap_ref);
f->cur_segmap = f->prev_segmap_ref->data;
} else {
res = -EINVAL;
goto error;
}
} else {
......
Markdown is supported
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