Commit c7141658 authored by Luc Trudeau's avatar Luc Trudeau

Fix undefined-behavior in obu.c

Removes undefined-behavior when primary_ref_frame is 7
parent 7b705481
......@@ -590,10 +590,14 @@ static int parse_frame_hdr(Dav1dContext *const c, GetBits *const gb,
hdr->segmentation.seg_data.preskip = 1;
}
}
} else if (hdr->primary_ref_frame == PRIMARY_REF_NONE) {
memset(&hdr->segmentation.seg_data, 0, sizeof(Av1SegmentationDataSet));
} else {
const int pri_ref = hdr->refidx[hdr->primary_ref_frame];
hdr->segmentation.seg_data = c->refs[pri_ref].seg_data;
}
} else if (hdr->primary_ref_frame == PRIMARY_REF_NONE) {
memset(&hdr->segmentation.seg_data, 0, sizeof(Av1SegmentationDataSet));
} else {
const int pri_ref = hdr->refidx[hdr->primary_ref_frame];
hdr->segmentation.seg_data = c->refs[pri_ref].seg_data;
......
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