From 6c51de5d9cd7125b1022563edcda6fcee01bf1ee Mon Sep 17 00:00:00 2001 From: theubusu <80545678+theubusu@users.noreply.github.com> Date: Wed, 27 May 2026 22:25:00 +0200 Subject: [PATCH] tsb_bin: fix false detection when header is all zeros --- src/formats/tsb_bin/include.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/formats/tsb_bin/include.rs b/src/formats/tsb_bin/include.rs index 7f31ee7..9cffe5b 100644 --- a/src/formats/tsb_bin/include.rs +++ b/src/formats/tsb_bin/include.rs @@ -65,5 +65,5 @@ pub fn is_valid_header_checksum(header_data: &[u8]) -> bool { //expected checksum at end let exp = u32::from_be_bytes(header_data[252..256].try_into().unwrap()); - calc == exp + calc == exp && exp != 0 /* for false positive (SHOULD BE IMPROVED) */ } \ No newline at end of file