mirror of
https://code.videolan.org/videolan/dav1d
synced 2024-11-14 22:58:33 +01:00
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 <jamrial@gmail.com>
This commit is contained in:
parent
5f8b6d0cb9
commit
18335a4da0
10
src/obu.c
10
src/obu.c
@ -1049,17 +1049,20 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) {
|
||||
c->have_seq_hdr = 1;
|
||||
c->have_frame_hdr = 0;
|
||||
break;
|
||||
case OBU_REDUNDANT_FRAME_HDR:
|
||||
if (c->have_frame_hdr) break;
|
||||
// fall-through
|
||||
case OBU_FRAME:
|
||||
case OBU_FRAME_HDR:
|
||||
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;
|
||||
c->have_frame_hdr = 1;
|
||||
for (int n = 0; n < c->n_tile_data; n++)
|
||||
dav1d_data_unref(&c->tile[n].data);
|
||||
c->n_tile_data = 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;
|
||||
off += res;
|
||||
// fall-through
|
||||
@ -1089,9 +1092,6 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) {
|
||||
c->tile[c->n_tile_data].start;
|
||||
c->n_tile_data++;
|
||||
break;
|
||||
case OBU_REDUNDANT_FRAME_HDR:
|
||||
if (!c->have_frame_hdr) goto error;
|
||||
break;
|
||||
case OBU_PADDING:
|
||||
case OBU_TD:
|
||||
case OBU_METADATA:
|
||||
|
Loading…
Reference in New Issue
Block a user