From 51382a9ad683e7b4d5907f63cd8e103f531f577c Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 14 Oct 2022 18:22:13 +0200 Subject: [PATCH] avi: ignore ODML 'ix' chunks at the beginning of 'movi' list --- nihav-commonfmt/src/demuxers/avi.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nihav-commonfmt/src/demuxers/avi.rs b/nihav-commonfmt/src/demuxers/avi.rs index 2329ae9..c4b4817 100644 --- a/nihav-commonfmt/src/demuxers/avi.rs +++ b/nihav-commonfmt/src/demuxers/avi.rs @@ -140,11 +140,16 @@ impl<'a> DemuxCore<'a> for AVIDemuxer<'a> { continue; } if (tag[0] == b'i' && tag[1] == b'x') || (&tag == b"idx1") { + let idx_pos = self.src.tell() - 8; if !self.odml { return Err(EOF); } self.src.read_skip(size)?; - self.try_next_odml_chunk()?; + if idx_pos > self.movi_pos { + self.try_next_odml_chunk()?; + } else { + self.movi_pos = self.src.tell(); + } continue; } if tag[0] < b'0' || tag[0] > b'9' || tag[1] < b'0' || tag[1] > b'9' { -- 2.30.2