Verified Commit 82404efb authored by James Almer's avatar James Almer
Browse files

obu: set have_frame_hdr to true only when there were no errors

parent 2b39cfb0
Pipeline #2877 passed with stages
in 7 minutes and 37 seconds
...@@ -1219,7 +1219,6 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) { ...@@ -1219,7 +1219,6 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) {
if (!c->have_seq_hdr) goto error; if (!c->have_seq_hdr) goto error;
if ((res = parse_frame_hdr(c, &gb)) < 0) if ((res = parse_frame_hdr(c, &gb)) < 0)
return res; return res;
c->have_frame_hdr = 1;
for (int n = 0; n < c->n_tile_data; n++) for (int n = 0; n < c->n_tile_data; n++)
dav1d_data_unref(&c->tile[n].data); dav1d_data_unref(&c->tile[n].data);
c->n_tile_data = 0; c->n_tile_data = 0;
...@@ -1231,11 +1230,14 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) { ...@@ -1231,11 +1230,14 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) {
if (check_for_overrun(&gb, init_bit_pos, len)) if (check_for_overrun(&gb, init_bit_pos, len))
return -EINVAL; return -EINVAL;
c->have_frame_hdr = 1;
break; break;
} }
// OBU_FRAMEs shouldn't be signalled with show_existing_frame // OBU_FRAMEs shouldn't be signalled with show_existing_frame
if (c->frame_hdr.show_existing_frame) goto error; if (c->frame_hdr.show_existing_frame) goto error;
c->have_frame_hdr = 1;
// This is the frame header at the start of a frame OBU. // This is the frame header at the start of a frame OBU.
// There's no trailing bit at the end to skip, but we do need // There's no trailing bit at the end to skip, but we do need
// to align to the next byte. // to align to the next byte.
......
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