From 8408bfdd319de2984ea18e05b1d644e86406f4e2 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Mon, 31 Mar 2025 18:08:37 +0200 Subject: [PATCH] h264: use uninitalised buffer for MC --- nihav-itu/src/codecs/h264/dsp/mc/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.39.5