Commit b53fa245 by olly Committed by Oliver Woodman

Fix ID3 EOS detection for two-byte encodings

Issue: #1774

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131389528
parent 09c58004
...@@ -98,7 +98,7 @@ public final class Id3Decoder implements MetadataDecoder<List<Id3Frame>> { ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment