From e5ee9a29f58a41bae17bfb3657b2698bd54efb63 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 20 May 2023 16:53:47 +0200 Subject: [PATCH] core/scale: fix off-by-one typo --- nihav-core/src/scale/colorcvt.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]; -- 2.30.2