Skip to content

Commit

Permalink
mkv: fixed off-by-one error in FixedSize lacing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
darksv committed Nov 18, 2021
1 parent a9e5d81 commit 911affc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions symphonia-format-mkv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ fn extract_frames(block: &[u8], buffer: &mut VecDeque<(u32, Box<[u8]>)>) -> Resu
buffer.push_back((track, reader.read_boxed_slice_exact(size)?));
}
Lacing::FixedSize => {
let frames = reader.read_byte()? as usize;
let frames = reader.read_byte()? as usize + 1;
let total_size = block.len() - reader.pos() as usize;
if total_size % frames != 0 {
return Err(Error::DecodeError("mkv: invalid block size"));
Expand Down Expand Up @@ -322,7 +322,7 @@ impl FormatReader for MkvReader {
}
}

match header.etype {
match dbg!(header).etype {
ElementType::Cluster => {
self.current_cluster = Some(ClusterState {
timestamp: None,
Expand Down

0 comments on commit 911affc

Please sign in to comment.