From f8b4bb7b585c736a76aabc2af6757978fce649ad Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Tue, 7 Apr 2020 16:33:48 +0200 Subject: [PATCH] rv10: check quantiser --- nihav-realmedia/src/codecs/rv10.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nihav-realmedia/src/codecs/rv10.rs b/nihav-realmedia/src/codecs/rv10.rs index 7cfc4c3..be4c76d 100644 --- a/nihav-realmedia/src/codecs/rv10.rs +++ b/nihav-realmedia/src/codecs/rv10.rs @@ -258,6 +258,7 @@ impl<'a> BlockDecoder for RealVideo10BR<'a> { if dquant { let idx = br.read(2)? as usize; q = ((q as i16) + (H263_DQUANT_TAB[idx] as i16)) as u8; + validate!(q < 32); } Ok(BlockInfo::new(Type::I, cbp, q)) }, @@ -276,6 +277,7 @@ impl<'a> BlockDecoder for RealVideo10BR<'a> { if dquant { let idx = br.read(2)? as usize; q = ((q as i16) + (H263_DQUANT_TAB[idx] as i16)) as u8; + validate!(q < 32); } let binfo = BlockInfo::new(Type::I, cbp, q); return Ok(binfo); @@ -289,6 +291,7 @@ impl<'a> BlockDecoder for RealVideo10BR<'a> { if dquant { let idx = br.read(2)? as usize; q = ((q as i16) + (H263_DQUANT_TAB[idx] as i16)) as u8; + validate!(q < 32); } let mut binfo = BlockInfo::new(Type::P, cbp, q); if !is_4x4 { -- 2.39.5