From 6130c973810971098fc6e4deb3ac71816a5ee093 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Thu, 20 May 2021 17:34:45 +0200 Subject: [PATCH] deflate: fix copy block length check --- nihav-core/src/compr/deflate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nihav-core/src/compr/deflate.rs b/nihav-core/src/compr/deflate.rs index 89e0fde..13d9ad5 100644 --- a/nihav-core/src/compr/deflate.rs +++ b/nihav-core/src/compr/deflate.rs @@ -426,7 +426,7 @@ impl Inflate { }, InflateState::StaticBlockInvLen(len) => { let inv_len = read_bits!(self, csrc, 16); - if len != !inv_len { + if (len ^ inv_len) != 0xFFFF { self.state = InflateState::End; return Err(DecompressError::InvalidHeader); } -- 2.39.5