Commit aeb5a5ef authored by James Almer's avatar James Almer

explicitly clear some Dav1dRef pointers after calling dav1d_ref_dec()

Partially reverts b7d2b7d2, fixing a regression
introduced by it.
parent b7d2b7d2
......@@ -3018,7 +3018,9 @@ int dav1d_submit_frame(Dav1dContext *const c) {
if (f->cur_segmap_ref)
dav1d_ref_inc(f->cur_segmap_ref);
dav1d_ref_dec(&c->refs[i].refmvs);
if (!f->frame_hdr.allow_intrabc) {
if (f->frame_hdr.allow_intrabc) {
c->refs[i].refmvs = NULL;
} else {
c->refs[i].refmvs = f->mvs_ref;
if (f->mvs_ref)
dav1d_ref_inc(f->mvs_ref);
......@@ -3038,7 +3040,9 @@ int dav1d_submit_frame(Dav1dContext *const c) {
if (c->cdf[i].cdf)
dav1d_cdf_thread_unref(&c->cdf[i]);
dav1d_ref_dec(&c->refs[i].segmap);
c->refs[i].segmap = NULL;
dav1d_ref_dec(&c->refs[i].refmvs);
c->refs[i].refmvs = NULL;
}
}
return res;
......
......@@ -1060,7 +1060,9 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) {
if (c->refs[i].p.p.data[0])
dav1d_thread_picture_unref(&c->refs[i].p);
dav1d_ref_dec(&c->refs[i].segmap);
c->refs[i].segmap = NULL;
dav1d_ref_dec(&c->refs[i].refmvs);
c->refs[i].refmvs = NULL;
if (c->cdf[i].cdf)
dav1d_cdf_thread_unref(&c->cdf[i]);
}
......@@ -1187,6 +1189,7 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) {
if (c->refs[r].segmap)
dav1d_ref_inc(c->refs[r].segmap);
dav1d_ref_dec(&c->refs[i].refmvs);
c->refs[i].refmvs = NULL;
c->refs[i].qidx = c->refs[r].qidx;
}
}
......
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