]> git.nihav.org Git - nihav.git/commitdiff
rv20: validate slice start
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 4 Apr 2020 10:27:17 +0000 (12:27 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 4 Apr 2020 10:27:17 +0000 (12:27 +0200)
nihav-realmedia/src/codecs/rv20.rs

index 8e4965aa471fbc6698e2e1b137c32929af64f772..0e743969d306795bfe5ebeb4aaec9833229ca282 100644 (file)
@@ -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 {