From cabb94df3f6e19f0deceb02f8e60459d6f40c69b Mon Sep 17 00:00:00 2001 From: James Almer Date: Thu, 7 Apr 2022 23:32:25 -0300 Subject: obu: check refresh_frame_flags is not equal to allFrames on Intra Only frames From section 6.8.2 in the AV1 spec: "If frame_type is equal to INTRA_ONLY_FRAME, it is a requirement of bitstream conformance that refresh_frame_flags is not equal to 0xff." Make this a soft requirement by checking that strict standard complaince is enabled. --- src/obu.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/obu.c b/src/obu.c index 7df6850..4145988 100644 --- a/src/obu.c +++ b/src/obu.c @@ -454,6 +454,11 @@ static int parse_frame_hdr(Dav1dContext *const c, GetBits *const gb) { if (hdr->refresh_frame_flags != 0xff && hdr->error_resilient_mode && seqhdr->order_hint) for (int i = 0; i < 8; i++) dav1d_get_bits(gb, seqhdr->order_hint_n_bits); + if (c->strict_std_compliance && + hdr->frame_type == DAV1D_FRAME_TYPE_INTRA && hdr->refresh_frame_flags == 0xff) + { + goto error; + } if (read_frame_size(c, gb, 0) < 0) goto error; hdr->allow_intrabc = hdr->allow_screen_content_tools && !hdr->super_res.enabled && dav1d_get_bits(gb, 1); -- cgit v1.2.3