]> git.nihav.org Git - nihav-encoder.git/commitdiff
palettise: clear the unused part of the palette
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 25 Apr 2026 10:59:36 +0000 (12:59 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 25 Apr 2026 10:59:36 +0000 (12:59 +0200)
src/palettise.rs

index 2025232cf5a479afdc74d5619fe8369a1b377f70..5342c1c5e4416810bab4d598be915d5e35074251 100644 (file)
@@ -463,6 +463,9 @@ pub fn create_palettiser(enc_opts: &[OptionArgs]) -> Option<Palettiser> {
             _ => {},
         }
     }
+    for clr in pal.iter_mut().skip(nclrs) {
+        *clr = [0; 3];
+    }
     if pmode.is_some() || pal_is_some {
         Some(Palettiser::new(pmode.unwrap_or_default(), &pal, nclrs))
     } else {