From 3962e3e613c33325c33ae6e318e558d0fd098511 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Thu, 21 Aug 2025 18:06:04 +0200 Subject: [PATCH] avi: ignore non-existent audio extradata --- nihav-commonfmt/src/demuxers/avi.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nihav-commonfmt/src/demuxers/avi.rs b/nihav-commonfmt/src/demuxers/avi.rs index de7d705..a5cd9eb 100644 --- a/nihav-commonfmt/src/demuxers/avi.rs +++ b/nihav-commonfmt/src/demuxers/avi.rs @@ -734,10 +734,13 @@ fn parse_strf_auds(dmx: &mut AVIDemuxer, strmgr: &mut StreamManager, size: usize let signed = bits_per_sample > 8; let soniton = NASoniton::new(bits_per_sample as u8, if signed { SONITON_FLAG_SIGNED } else { 0 }); let ahdr = NAAudioInfo::new(samplespersec, channels as u8, soniton, block_align as usize); - let edata = if size > 16 { + let edata = if size > 18 { let edata_size = dmx.src.read_u16le()? as usize; validate!(edata_size + 18 <= size); dmx.read_extradata(size - 18)? + } else if size > 16 { + dmx.src.read_skip(size - 16)?; + None } else { None }; -- 2.39.5