From: Kostya Shishkov Date: Sat, 20 May 2023 14:53:47 +0000 (+0200) Subject: core/scale: fix off-by-one typo X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;ds=sidebyside;h=e5ee9a29f58a41bae17bfb3657b2698bd54efb63;p=nihav.git core/scale: fix off-by-one typo --- diff --git a/nihav-core/src/scale/colorcvt.rs b/nihav-core/src/scale/colorcvt.rs index 00ae2a5..4b076d6 100644 --- a/nihav-core/src/scale/colorcvt.rs +++ b/nihav-core/src/scale/colorcvt.rs @@ -265,8 +265,8 @@ impl Kernel for RgbToYuv { let (y, u, v) = matrix_mul(&self.matrix, r, g, b); dst[yoff + x] = (y as i16).max(0).min(255) as u8; - dst[uoff + x] = ((u as i16).max(-128).min(128) + 128) as u8; - dst[voff + x] = ((v as i16).max(-128).min(128) + 128) as u8; + dst[uoff + x] = ((u as i16).max(-128).min(127) + 128) as u8; + dst[voff + x] = ((v as i16).max(-128).min(127) + 128) as u8; } roff += istrides[0]; goff += istrides[1];