Skip to content

Commit

Permalink
FIX: Empty frames
Browse files Browse the repository at this point in the history
  • Loading branch information
sander-willems-bruker committed Jan 24, 2024
1 parent fdbfaae commit 26fe670
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/file_readers/common/ms_data_blobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ impl BinFileReader {
&mmap[offset as usize..(offset + 4) as usize];
let byte_count: u32 =
u32::from_le_bytes(raw_byte_count.try_into().unwrap());
let compressed_blob: &[u8] = &mmap
[(offset + 8) as usize..offset as usize + byte_count as usize];
let blob: Vec<u8> = decode_all(compressed_blob).unwrap();
return blob;
if byte_count > 8 {
let compressed_blob: &[u8] = &mmap[(offset + 8) as usize
..offset as usize + byte_count as usize];
let blob: Vec<u8> = decode_all(compressed_blob).unwrap();
return blob;
}
};
return vec![0];
return vec![];
}

pub fn size(&self) -> usize {
Expand Down

0 comments on commit 26fe670

Please sign in to comment.