Skip to content

Commit

Permalink
fn rav1d_parse_obus: Remove a r#type != RAV1D_OBU_FRAME early `br…
Browse files Browse the repository at this point in the history
…eak` from the `switch` state machine.
  • Loading branch information
kkysen committed Dec 8, 2023
1 parent 242e602 commit eb11988
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/obu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1977,21 +1977,20 @@ pub(crate) unsafe fn rav1d_parse_obus(
return Err(ERANGE);
}

if r#type != RAV1D_OBU_FRAME {
break;
}
// OBU_FRAMEs shouldn't be signaled with `show_existing_frame`.
if (*c.frame_hdr).show_existing_frame != 0 {
c.frame_hdr = 0 as *mut Rav1dFrameHeader;
error(c, r#in)?;
}
if r#type == RAV1D_OBU_FRAME {
// OBU_FRAMEs shouldn't be signaled with `show_existing_frame`.
if (*c.frame_hdr).show_existing_frame != 0 {
c.frame_hdr = 0 as *mut Rav1dFrameHeader;
error(c, r#in)?;
}

// 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 to align to the next byte.
rav1d_bytealign_get_bits(&mut gb);
if global == 0 {
parse_tile_grp(c, r#in, &mut gb, init_bit_pos, init_byte_pos, len)?;
// 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 to align to the next byte.
rav1d_bytealign_get_bits(&mut gb);
if global == 0 {
parse_tile_grp(c, r#in, &mut gb, init_bit_pos, init_byte_pos, len)?;
}
}
}
RAV1D_OBU_TILE_GRP => {
Expand Down

0 comments on commit eb11988

Please sign in to comment.