From: Kostya Shishkov Date: Tue, 7 Apr 2020 14:33:48 +0000 (+0200) Subject: rv10: check quantiser X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=f8b4bb7b585c736a76aabc2af6757978fce649ad;p=nihav.git rv10: check quantiser --- 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 {