Skip to content

Commit

Permalink
Fixed 2 issues with Cea708Decoder.
Browse files Browse the repository at this point in the history
The first issue occurs when we attempt to process a DtvCcPacket that hasn't been completely filled. In this case we attempted to extract data beyond the length of the packet, instead of dropping the packet as we should have. The other issue occurs when we encountered an invalid cc_data_pkt. In that case we were finalizing the entire DtvCcPacket, instead of just ignoring that particular cc_data_pkt as we should have.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146373074
  • Loading branch information
cdrolle authored and ojw28 committed Feb 15, 2017
1 parent 0402191 commit 537a3ab
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ protected void decode(SubtitleInputBuffer inputBuffer) {
}

if (!ccValid) {
finalizeCurrentPacket();
// This byte-pair isn't valid, ignore it and continue.
continue;
}

Expand Down Expand Up @@ -259,7 +259,8 @@ private void processCurrentPacket() {
if (currentDtvCcPacket.currentIndex != (currentDtvCcPacket.packetSize * 2 - 1)) {
Log.w(TAG, "DtvCcPacket ended prematurely; size is " + (currentDtvCcPacket.packetSize * 2 - 1)
+ ", but current index is " + currentDtvCcPacket.currentIndex + " (sequence number "
+ currentDtvCcPacket.sequenceNumber + ")");
+ currentDtvCcPacket.sequenceNumber + "); ignoring packet");
return;
}

serviceBlockPacket.reset(currentDtvCcPacket.packetData, currentDtvCcPacket.currentIndex);
Expand Down

0 comments on commit 537a3ab

Please sign in to comment.