Fix bug in RepeatStart, implement as Silence.

This commit is contained in:
Pedro de Oliveira 2022-11-13 17:07:52 +00:00
parent 108336e5a0
commit d6737050ca
1 changed files with 2 additions and 2 deletions

View File

@ -506,7 +506,7 @@ impl RepeatStart {
pub fn from_stream(fp: &mut File, _end_address: i32) -> Self {
let mut count_buffer: [u8; 2] = [0; 2];
drop(fp.read(&mut count_buffer));
let count = u16::from_le_bytes(count_buffer);
let count = u16::from_le_bytes(count_buffer) + 1;
Self::new(count)
}
@ -515,7 +515,7 @@ impl RepeatStart {
impl Block for RepeatStart {
fn to_bytes(&self) -> Vec<u8> {
let size_bytes: [u8; 4] = 2u32.to_le_bytes();
let count_bytes: [u8; 2] = self.count.to_le_bytes();
let count_bytes: [u8; 2] = (self.count - 1).to_le_bytes();
let result: Vec<u8> = vec![
self.block_type as u8,