The global ID3 Unsynch flag, when set, should be applied to all tags. When not applied, this can result in incorrect reads and, more importantly, crashes as the tag name and length of subsequent tags gets skewed. As an example, this problem has been found when CD ID tags are encoded as binary strings using EAC.
The solution I found to this is to pass the global unsynch flag to the ID3v2Frame.ReadFrame() method, and changed the line:
stream.Read(frameData, 0, length);
to:
stream.Read(frameData, 0, length);
if (unsynchFlag)
{
// Need to check for occurences of 0xFF 0x00
for (int i = 0; i < length - 1; i++)
{
if (frameData[i] == 0xff && frameData[i + 1] == 0)
{
if ( i < length -2)
Array.Copy(frameData, i + 2, frameData, i + 1, length - i - 1);
// Read in another byte to make up for masked byte that is removed
stream.Read(frameData, length - 1, 1);
}
}
}
I hope this helps someone.
Cheers.