From e9faee5e31247e96d6e59f50f9ef89ff9be2dfb5 Mon Sep 17 00:00:00 2001 From: darksv Date: Thu, 18 Nov 2021 19:13:53 +0100 Subject: [PATCH] mkv: fixed off-by-one error in FixedSize lacing mode --- symphonia-format-mkv/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symphonia-format-mkv/src/lib.rs b/symphonia-format-mkv/src/lib.rs index d9a389c4..9baa2dee 100644 --- a/symphonia-format-mkv/src/lib.rs +++ b/symphonia-format-mkv/src/lib.rs @@ -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"));