From 5dbd154052b17950c724d61c51adb5adb11b1dc7 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Mon, 15 Jun 2020 14:38:47 +0200 Subject: [PATCH] avi: fix index parsing --- nihav-commonfmt/src/demuxers/avi.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- 2.39.5