From: Kostya Shishkov Date: Thu, 20 May 2021 15:34:45 +0000 (+0200) Subject: deflate: fix copy block length check X-Git-Url: https://git.nihav.org/?p=nihav.git;a=commitdiff_plain;h=6130c973810971098fc6e4deb3ac71816a5ee093 deflate: fix copy block length check --- 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); }