From 843c8c87a1d0df3a3522f34c9c256be72c7c1f18 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 20 Oct 2018 12:57:47 +0200 Subject: [PATCH] rmdec: skip RM-specific first byte of AAC extradata --- src/demuxers/realmedia.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/demuxers/realmedia.rs b/src/demuxers/realmedia.rs index 020e8c0..571f97b 100644 --- a/src/demuxers/realmedia.rs +++ b/src/demuxers/realmedia.rs @@ -653,7 +653,7 @@ fn parse_aformat5(src: &mut ByteReader) -> DemuxerResult { if has_ileave_pattern != 0 { unimplemented!("ra5 interleave pattern"); } - let edata_size = src.read_u32be()?; + let mut edata_size = src.read_u32be()?; let end = src.tell(); validate!(end - start <= (header_size as u64) + 10); @@ -666,6 +666,11 @@ unimplemented!("ra5 interleave pattern"); } else { None }; + if (fcc == mktag!(b"raac")) || (fcc == mktag!(b"racp")) { + validate!(edata_size > 1); + edata_size -= 1; + src.read_skip(1)?; + } Ok(RealAudioInfo { fcc: fcc, flavor: flavor, -- 2.39.5