Skip to content

Commit

Permalink
Use int for an unsigned byte value in Cea608Decoder
Browse files Browse the repository at this point in the history
This is a no-op, but it's more 'correct' because it avoids any potential
sign mix-ups that come from storing an unsigned byte (with a
potentially set MSB) in a signed java byte variable.

PiperOrigin-RevId: 483409798
  • Loading branch information
icbaker authored and microkatz committed Oct 31, 2022
1 parent a7bfa12 commit 3d0f43a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ protected void decode(SubtitleInputBuffer inputBuffer) {
ccData.reset(subtitleData.array(), subtitleData.limit());
boolean captionDataProcessed = false;
while (ccData.bytesLeft() >= packetLength) {
byte ccHeader =
packetLength == 2 ? CC_IMPLICIT_DATA_HEADER : (byte) ccData.readUnsignedByte();
int ccHeader = packetLength == 2 ? CC_IMPLICIT_DATA_HEADER : ccData.readUnsignedByte();

int ccByte1 = ccData.readUnsignedByte();
int ccByte2 = ccData.readUnsignedByte();

Expand Down

0 comments on commit 3d0f43a

Please sign in to comment.