Fix ID3 EOS detection for two-byte encodings

Issue: #1774

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131389528
This commit is contained in:
olly 2016-08-26 04:47:15 -07:00 committed by Oliver Woodman
parent 09c58004dc
commit b53fa245ce

View File

@ -98,7 +98,7 @@ public final class Id3Decoder implements MetadataDecoder<List<Id3Frame>> {
// Otherwise look for a second zero byte. // Otherwise look for a second zero byte.
while (terminationPos < data.length - 1) { while (terminationPos < data.length - 1) {
if (data[terminationPos + 1] == (byte) 0) { if (terminationPos % 2 == 0 && data[terminationPos + 1] == (byte) 0) {
return terminationPos; return terminationPos;
} }
terminationPos = indexOfZeroByte(data, terminationPos + 1); terminationPos = indexOfZeroByte(data, terminationPos + 1);