From 9aa783a06bd06350dacc3f1447f310db1f6fd3f1 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Mon, 6 Jul 2020 14:16:04 +0200 Subject: [PATCH] mov: if audio extradata does not start with wave pass it in full --- nihav-commonfmt/src/demuxers/mov.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nihav-commonfmt/src/demuxers/mov.rs b/nihav-commonfmt/src/demuxers/mov.rs index 4904697..c10bb2d 100644 --- a/nihav-commonfmt/src/demuxers/mov.rs +++ b/nihav-commonfmt/src/demuxers/mov.rs @@ -428,6 +428,14 @@ const STBL_CHUNK_HANDLERS: &[TrackChunkHandler] = &[ fn parse_audio_edata(br: &mut ByteReader, start_pos: u64, size: u64) -> DemuxerResult>> { let read_part = br.tell() - start_pos; if read_part + 8 < size { + let mut buf = [0; 8]; + br.peek_buf(&mut buf)?; + if &buf[4..8] != b"wave" { + let mut buf = vec![0; (size - read_part) as usize]; + br.read_buf(&mut buf)?; + return Ok(Some(buf)); + } + let csize = br.read_u32be()? as u64; let ctag = br.read_u32be()?; validate!(read_part + csize <= size); -- 2.39.5