]> git.nihav.org Git - nihav.git/commitdiff
avi: ignore ODML 'ix' chunks at the beginning of 'movi' list
authorKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 14 Oct 2022 16:22:13 +0000 (18:22 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 14 Oct 2022 16:22:13 +0000 (18:22 +0200)
nihav-commonfmt/src/demuxers/avi.rs

index 2329ae9be27c0ff893f453b697652060b8b4c8d8..c4b4817c633b335e62b01b739f3668da4ba7b8c2 100644 (file)
@@ -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' {