Fixed 2 issues with Cea708Decoder.

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
This commit is contained in:
cdrolle 2017-02-02 09:40:28 -08:00 committed by Oliver Woodman
parent 0402191ace
commit 537a3ab5be

View File

@ -211,7 +211,7 @@ public final class Cea708Decoder extends CeaDecoder {
}
if (!ccValid) {
finalizeCurrentPacket();
// This byte-pair isn't valid, ignore it and continue.
continue;
}
@ -259,7 +259,8 @@ public final class Cea708Decoder extends CeaDecoder {
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);