Skip to content

Commit

Permalink
Fix ID3 EOS detection for two-byte encodings
Browse files Browse the repository at this point in the history
Issue: #1774

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131389528
  • Loading branch information
ojw28 committed Aug 31, 2016
1 parent 09c5800 commit b53fa24
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private static int indexOfEos(byte[] data, int fromIndex, int encoding) {

// Otherwise look for a second zero byte.
while (terminationPos < data.length - 1) {
if (data[terminationPos + 1] == (byte) 0) {
if (terminationPos % 2 == 0 && data[terminationPos + 1] == (byte) 0) {
return terminationPos;
}
terminationPos = indexOfZeroByte(data, terminationPos + 1);
Expand Down

0 comments on commit b53fa24

Please sign in to comment.