From: Kostya Shishkov Date: Mon, 15 Jun 2020 12:38:47 +0000 (+0200) Subject: avi: fix index parsing X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=5dbd154052b17950c724d61c51adb5adb11b1dc7;p=nihav.git avi: fix index parsing --- diff --git a/nihav-commonfmt/src/demuxers/avi.rs b/nihav-commonfmt/src/demuxers/avi.rs index 11f0bce..1b59aac 100644 --- a/nihav-commonfmt/src/demuxers/avi.rs +++ b/nihav-commonfmt/src/demuxers/avi.rs @@ -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); }