From b53fa245ce1791247a340e008b419773a1183165 Mon Sep 17 00:00:00 2001 From: olly Date: Fri, 26 Aug 2016 04:47:15 -0700 Subject: [PATCH] Fix ID3 EOS detection for two-byte encodings Issue: #1774 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=131389528 --- .../com/google/android/exoplayer2/metadata/id3/Id3Decoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/main/java/com/google/android/exoplayer2/metadata/id3/Id3Decoder.java b/library/src/main/java/com/google/android/exoplayer2/metadata/id3/Id3Decoder.java index 723a29e0570..92c6efb5305 100644 --- a/library/src/main/java/com/google/android/exoplayer2/metadata/id3/Id3Decoder.java +++ b/library/src/main/java/com/google/android/exoplayer2/metadata/id3/Id3Decoder.java @@ -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);