From 95b5b2b52a15930d136f7c7592a93903d9d5f59a Mon Sep 17 00:00:00 2001 From: Zeugma440 Date: Sun, 28 Jan 2024 16:20:34 +0100 Subject: [PATCH] WAV : Ignore ending 0XFF padding when parsing iXML chunks --- ATL/AudioData/IO/Helpers/IXmlTag.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ATL/AudioData/IO/Helpers/IXmlTag.cs b/ATL/AudioData/IO/Helpers/IXmlTag.cs index 3312d4f9..5ec7faeb 100644 --- a/ATL/AudioData/IO/Helpers/IXmlTag.cs +++ b/ATL/AudioData/IO/Helpers/IXmlTag.cs @@ -41,7 +41,7 @@ public static void FromStream(Stream source, MetaDataIO meta, ReadTagParams read long initialOffset = source.Position; int nbSkipBegin = StreamUtils.SkipValues(source, new[] { 10, 13, 32, 0 }); // Ignore leading CR, LF, whitespace, null source.Seek(initialOffset + chunkSize, SeekOrigin.Begin); - int nbSkipEnd = StreamUtils.SkipValuesEnd(source, new[] { 10, 13, 32, 0 }); // Ignore ending CR, LF, whitespace, null + int nbSkipEnd = StreamUtils.SkipValuesEnd(source, new[] { 10, 13, 32, 0, 0xFF }); // Ignore ending CR, LF, whitespace, null, 0xFF source.Seek(initialOffset + nbSkipBegin, SeekOrigin.Begin); using (MemoryStream mem = new MemoryStream((int)chunkSize - nbSkipBegin - nbSkipEnd)) @@ -70,7 +70,7 @@ private static void readXml(Stream mem, Encoding encoding, IList positio int listDepth = 0; int listCounter = 1; - using (XmlReader reader = (null == encoding) ? XmlReader.Create(mem) : XmlReader.Create(new StreamReader(mem, encoding))) + using (XmlReader reader = null == encoding ? XmlReader.Create(mem) : XmlReader.Create(new StreamReader(mem, encoding))) { while (reader.Read()) {