From: Kostya Shishkov Date: Sat, 4 Apr 2020 10:27:17 +0000 (+0200) Subject: rv20: validate slice start X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=1b6a1780de9e8f350bfea12394bbf1d59bef4d46;p=nihav.git rv20: validate slice start --- diff --git a/nihav-realmedia/src/codecs/rv20.rs b/nihav-realmedia/src/codecs/rv20.rs index 8e4965a..0e74396 100644 --- a/nihav-realmedia/src/codecs/rv20.rs +++ b/nihav-realmedia/src/codecs/rv20.rs @@ -353,6 +353,7 @@ impl<'a> BlockDecoder for RealVideo20BR<'a> { if self.slice_no < self.num_slices { let pos = self.br.tell(); let shdr2 = self.read_slice_header()?; + validate!(shdr2.mb_pos > shdr.mb_pos); mb_count = shdr2.mb_pos - shdr.mb_pos; self.br.seek(pos as u32)?; } else {