Handle empty PRIV frames

Issue: #2486

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=148217936
This commit is contained in:
olly 2017-02-22 07:39:05 -08:00 committed by Oliver Woodman
parent ddbced7317
commit 698e081eda

View File

@ -404,6 +404,11 @@ public final class Id3Decoder implements MetadataDecoder {
private static PrivFrame decodePrivFrame(ParsableByteArray id3Data, int frameSize)
throws UnsupportedEncodingException {
if (frameSize == 0) {
// Frame is empty.
return new PrivFrame("", new byte[0]);
}
byte[] data = new byte[frameSize];
id3Data.readBytes(data, 0, frameSize);