]> git.nihav.org Git - nihav.git/commitdiff
avi: ignore zero frames
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 30 Jul 2017 10:15:28 +0000 (12:15 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 30 Jul 2017 11:02:08 +0000 (13:02 +0200)
src/demuxers/avi.rs

index c00df25ad8682626d4ebdfcb94377f3f934590bd..9eb951779dcc1a8820276f7b71b761205d7a4a0c 100644 (file)
@@ -104,6 +104,11 @@ impl<'a> Demux<'a> for AVIDemuxer<'a> {
             let str = self.dmx.get_stream(stream_no as usize);
             if let None = str { return Err(InvalidData); }
             let stream = str.unwrap();
+            if size == 0 {
+                self.movi_size -= 8;
+                if self.movi_size == 0 { return Err(EOF); }
+                continue;
+            }
             let (tb_num, tb_den) = stream.get_timebase();
             let ts = NATimeInfo::new(Some(self.cur_frame[stream_no as usize]), None, None, tb_num, tb_den);
             let pkt = self.src.read_packet(stream, ts, false, size)?;