Skip to content

Commit

Permalink
WAV : Ignore ending 0XFF padding when parsing iXML chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeugma440 committed Jan 28, 2024
1 parent 6972016 commit 95b5b2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ATL/AudioData/IO/Helpers/IXmlTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -70,7 +70,7 @@ private static void readXml(Stream mem, Encoding encoding, IList<string> 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())
{
Expand Down

0 comments on commit 95b5b2b

Please sign in to comment.