From 9d2db2234d6c97dd13f6ca693d370b1e67bd8bed Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Mon, 18 Oct 2021 18:51:09 +0200 Subject: [PATCH] core/scale: fix corner case in mediancut palettiser --- nihav-core/src/scale/palette/mediancut.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nihav-core/src/scale/palette/mediancut.rs b/nihav-core/src/scale/palette/mediancut.rs index 497cc4a..64281ef 100644 --- a/nihav-core/src/scale/palette/mediancut.rs +++ b/nihav-core/src/scale/palette/mediancut.rs @@ -78,7 +78,7 @@ impl<'a> VQBox<'a> { let box0; let box1; - if (dr > dg) && (dr > db) { + if (dr > dg) && (dr >= db) { let pivot = Self::sort(self.pixels, |pix| pix.r as usize); let (part0, part1) = self.pixels.split_at_mut(pivot); let (min0, max0) = Self::calc_min_and_max(part0); -- 2.39.5