Verified Commit 18335a4d authored by James Almer's avatar James Almer
Browse files

obu: don't abort OBU_REDUNDANT_FRAME_HDR if no frame header has been parsed



Parse and use it instead.
Signed-off-by: James Almer's avatarJames Almer <jamrial@gmail.com>
parent 5f8b6d0c
Pipeline #1292 passed with stage
in 2 minutes and 15 seconds
...@@ -1049,17 +1049,20 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) { ...@@ -1049,17 +1049,20 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) {
c->have_seq_hdr = 1; c->have_seq_hdr = 1;
c->have_frame_hdr = 0; c->have_frame_hdr = 0;
break; break;
case OBU_REDUNDANT_FRAME_HDR:
if (c->have_frame_hdr) break;
// fall-through
case OBU_FRAME: case OBU_FRAME:
case OBU_FRAME_HDR: case OBU_FRAME_HDR:
if (!c->have_seq_hdr) goto error; if (!c->have_seq_hdr) goto error;
if ((res = parse_frame_hdr(c, &gb, type == OBU_FRAME_HDR)) < 0) if ((res = parse_frame_hdr(c, &gb, type != OBU_FRAME)) < 0)
return res; return res;
c->have_frame_hdr = 1; 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;
c->n_tiles = 0; c->n_tiles = 0;
if (type == OBU_FRAME_HDR) break; if (type != OBU_FRAME) break;
if (c->frame_hdr.show_existing_frame) goto error; if (c->frame_hdr.show_existing_frame) goto error;
off += res; off += res;
// fall-through // fall-through
...@@ -1089,9 +1092,6 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) { ...@@ -1089,9 +1092,6 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) {
c->tile[c->n_tile_data].start; c->tile[c->n_tile_data].start;
c->n_tile_data++; c->n_tile_data++;
break; break;
case OBU_REDUNDANT_FRAME_HDR:
if (!c->have_frame_hdr) goto error;
break;
case OBU_PADDING: case OBU_PADDING:
case OBU_TD: case OBU_TD:
case OBU_METADATA: case OBU_METADATA:
......
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