From: Kostya Shishkov Date: Mon, 31 Mar 2025 16:08:37 +0000 (+0200) Subject: h264: use uninitalised buffer for MC X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=8408bfdd319de2984ea18e05b1d644e86406f4e2;p=nihav.git h264: use uninitalised buffer for MC --- diff --git a/nihav-itu/src/codecs/h264/dsp/mc/mod.rs b/nihav-itu/src/codecs/h264/dsp/mc/mod.rs index 615563e..776575f 100644 --- a/nihav-itu/src/codecs/h264/dsp/mc/mod.rs +++ b/nihav-itu/src/codecs/h264/dsp/mc/mod.rs @@ -82,7 +82,8 @@ impl H264MC { self.height = height; } pub fn do_mc(&mut self, frm: &mut NASimpleVideoFrame, refpic: &SimpleFrame, xpos: usize, ypos: usize, w: usize, h: usize, mv: MV) { - let mut ebuf = [0u8; 22 * 22]; + let ubuf = std::mem::MaybeUninit::<[u8; 22 * 22]>::uninit(); + let mut ebuf = unsafe { ubuf.assume_init() }; let mvx = mv.x >> 2; let mvy = mv.y >> 2; let mode = ((mv.x & 3) + (mv.y & 3) * 4) as usize;