From: Kostya Shishkov Date: Wed, 11 Feb 2026 17:29:39 +0000 (+0100) Subject: rawvideo_ms: reject too short input X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=0f34080436833fabb1c0d9058c35cb988ce091fa;p=nihav.git rawvideo_ms: reject too short input --- diff --git a/nihav-commonfmt/src/codecs/rawvideo_ms.rs b/nihav-commonfmt/src/codecs/rawvideo_ms.rs index 7e54578..e6ced10 100644 --- a/nihav-commonfmt/src/codecs/rawvideo_ms.rs +++ b/nihav-commonfmt/src/codecs/rawvideo_ms.rs @@ -32,6 +32,8 @@ impl NADecoder for RawDecoder { return Err(DecoderError::InvalidData); } let depth = if vinfo.format.is_paletted() { 8 } else { vinfo.format.get_total_depth() } as usize; + let stride = (width * depth + 31) / 32 * 4; + validate!(src.len() >= stride * height); let buf = match depth { 8 => { for sd in pkt.side_data.iter() {