From: Kostya Shishkov Date: Mon, 6 Jul 2020 12:16:04 +0000 (+0200) Subject: mov: if audio extradata does not start with wave pass it in full X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=9aa783a06bd06350dacc3f1447f310db1f6fd3f1;p=nihav.git mov: if audio extradata does not start with wave pass it in full --- 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);