From 1b6a1780de9e8f350bfea12394bbf1d59bef4d46 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 4 Apr 2020 12:27:17 +0200 Subject: [PATCH] rv20: validate slice start --- nihav-realmedia/src/codecs/rv20.rs | 1 + 1 file changed, 1 insertion(+) 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 { -- 2.39.5