cinepakenc: fix mask output optimisation
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 23 Feb 2023 16:48:24 +0000 (17:48 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 23 Feb 2023 16:48:24 +0000 (17:48 +0100)
nihav-commonfmt/src/codecs/cinepakenc.rs

index c6af8f61cdd9f71e55ef72a0e1cedf215d10ebc1..4729cd6050fb3f4a228ad20064189f597f78dfa6 100644 (file)
@@ -883,7 +883,7 @@ impl CinepakEncoder {
             let mut skip = true;
             for mask in self.masks.masks.iter() {
                 bw.write_u32be(*mask)?;
-                if *mask == 0 { continue; }
+                if *mask == 0 && skip { continue; }
                 let mut bit = 1 << 31;
                 while bit > 0 {
                     if skip {