From c7a1307604dd07413141fdc71529f3606622ac93 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Tue, 16 Jun 2020 15:52:06 +0200 Subject: [PATCH] avi: handle audio extradata shorter than chunk size --- nihav-commonfmt/src/demuxers/avi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nihav-commonfmt/src/demuxers/avi.rs b/nihav-commonfmt/src/demuxers/avi.rs index 71cdb01..43d154a 100644 --- a/nihav-commonfmt/src/demuxers/avi.rs +++ b/nihav-commonfmt/src/demuxers/avi.rs @@ -457,7 +457,7 @@ fn parse_strf_auds(dmx: &mut AVIDemuxer, strmgr: &mut StreamManager, size: usize let ahdr = NAAudioInfo::new(samplespersec, channels as u8, soniton, block_align as usize); let edata = if size > 16 { let edata_size = dmx.src.read_u16le()? as usize; - validate!(edata_size + 18 == size); + validate!(edata_size + 18 <= size); dmx.read_extradata(size - 18)? } else { None -- 2.39.5