From 9dc04b27b5c16e36d19632e70136379b738813ce Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 21 Oct 2022 17:47:02 +0200 Subject: [PATCH] avi: skip chunks from unknown streams --- nihav-commonfmt/src/demuxers/avi.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nihav-commonfmt/src/demuxers/avi.rs b/nihav-commonfmt/src/demuxers/avi.rs index bc39234..dc8ea6b 100644 --- a/nihav-commonfmt/src/demuxers/avi.rs +++ b/nihav-commonfmt/src/demuxers/avi.rs @@ -168,7 +168,11 @@ impl<'a> DemuxCore<'a> for AVIDemuxer<'a> { continue; } let str = strmgr.get_stream(stream_no as usize); - if str.is_none() { return Err(InvalidData); } + if str.is_none() { + self.src.read_skip(size)?; + self.movi_size -= size + 8; + continue; + } let stream = str.unwrap(); if size == 0 { self.movi_size -= 8; -- 2.39.5