You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MIME type string is assumed to be of variable encoding, but it is not. The specification says its type is <text string>, not <text string according to encoding>, so it must always be ISO-8859-1. As such, GetASCIIString should be called instead of the dynamically selected getstr.
This causes a crash with System.OverflowException when the entry contains no data because the position ends up improperly offset past the end of the string, resulting in position equalling Data.Length + 1, which makes datalength negative.
As an aside, if you ever release a version for .NET 5 or later (rather than targeting .NET Standard), the Encoding.ASCII references should be swapped out for Encoding.Latin1, which guarantees the correct ISO-8859-1 codepage. It only really matters when trying to use extended characters (beyond the 7-bit character set) in ASCII, but the discrepancy can lead to erroneous decoding/encoding of tags.
The MIME type string is assumed to be of variable encoding, but it is not. The specification says its type is
<text string>
, not<text string according to encoding>
, so it must always be ISO-8859-1. As such,GetASCIIString
should be called instead of the dynamically selectedgetstr
.NAudio.Lame/NAudio.Lame/ID3Decoder.cs
Lines 385 to 394 in 5b5bb00
This causes a crash with
System.OverflowException
when the entry contains no data because the position ends up improperly offset past the end of the string, resulting inposition
equallingData.Length + 1
, which makesdatalength
negative.This can be fixed by swapping line 387 out for:
This fixes the issue and prevents the crash.
The text was updated successfully, but these errors were encountered: