-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
Description
The end of string detection (introduced for issue 324) looks for a pair of zero bytes. It should look for a pair of zero bytes starting at an even index, otherwise it will incorrectly parse a string whose last character encoding ends with a 0 byte.
Suggested change to Id3Parser.indexOfEos:
// Otherwise ensure an even index and look for a second zero byte.
while (terminationPos < data.length - 1) {
if (terminationPos % 2 == 0 && data[terminationPos + 1] == (byte) 0) {
return terminationPos;
}
terminationPos = indexOfZeroByte(data, terminationPos + 1);
}
Reactions are currently unavailable