Skip to content

Commit

Permalink
Fix replacement char check
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 227646358
  • Loading branch information
andrewlewis authored and ojw28 committed Jan 8, 2019
1 parent 0ed7dde commit 440824a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@

private static final String LANGUAGE_UNDEFINED = "und";

private static final int TYPE_TOP_BYTE_COPYRIGHT = 0xA9;
private static final int TYPE_TOP_BYTE_REPLACEMENT = 0xFD; // Truncated value of \uFFFD.

private MetadataUtil() {}

/**
Expand All @@ -119,8 +122,7 @@ private MetadataUtil() {}
int type = ilst.readInt();
int typeTopByte = (type >> 24) & 0xFF;
try {
if (typeTopByte == '\u00A9' /* Copyright char */
|| typeTopByte == '\uFFFD' /* Replacement char */) {
if (typeTopByte == TYPE_TOP_BYTE_COPYRIGHT || typeTopByte == TYPE_TOP_BYTE_REPLACEMENT) {
int shortType = type & 0x00FFFFFF;
if (shortType == SHORT_TYPE_COMMENT) {
return parseCommentAttribute(type, ilst);
Expand Down

0 comments on commit 440824a

Please sign in to comment.