avi: fix index parsing
authorKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 15 Jun 2020 12:38:47 +0000 (14:38 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 15 Jun 2020 12:38:47 +0000 (14:38 +0200)
nihav-commonfmt/src/demuxers/avi.rs

index 11f0bce5d1dfcb55c84e6022982ba2b5e42fd83b..1b59aac22f541388c3cc636ddbf7e38939a420f6 100644 (file)
@@ -534,7 +534,8 @@ fn parse_idx1(src: &mut ByteReader, strmgr: &mut StreamManager, seek_idx: &mut S
                     let (tb_num, tb_den) = str.get_timebase();
                     let pts = counter[stream_no];
                     let time = NATimeInfo::ts_to_time(pts, 1000, tb_num, tb_den);
-                    seek_idx.add_entry(stream_no as u32, SeekEntry { time, pts, pos: offset + movi_pos - 4 });
+                    validate!(offset >= movi_pos);
+                    seek_idx.add_entry(stream_no as u32, SeekEntry { time, pts, pos: offset });
                 }
                 key_offs.push(offset);
             }