]> git.nihav.org Git - nihav.git/commitdiff
deflate: fix copy block length check
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 20 May 2021 15:34:45 +0000 (17:34 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 20 May 2021 15:34:45 +0000 (17:34 +0200)
nihav-core/src/compr/deflate.rs

index 89e0fde18de25502433060c2529499a6fba5eb58..13d9ad53c2270082d8295666d6beed53992702a5 100644 (file)
@@ -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);
                     }