Commit 537a3ab5 by cdrolle Committed by Oliver Woodman

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
parent 0402191a
...@@ -211,7 +211,7 @@ public final class Cea708Decoder extends CeaDecoder { ...@@ -211,7 +211,7 @@ public final class Cea708Decoder extends CeaDecoder {
} }
if (!ccValid) { if (!ccValid) {
finalizeCurrentPacket(); // This byte-pair isn't valid, ignore it and continue.
continue; continue;
} }
...@@ -259,7 +259,8 @@ public final class Cea708Decoder extends CeaDecoder { ...@@ -259,7 +259,8 @@ public final class Cea708Decoder extends CeaDecoder {
if (currentDtvCcPacket.currentIndex != (currentDtvCcPacket.packetSize * 2 - 1)) { if (currentDtvCcPacket.currentIndex != (currentDtvCcPacket.packetSize * 2 - 1)) {
Log.w(TAG, "DtvCcPacket ended prematurely; size is " + (currentDtvCcPacket.packetSize * 2 - 1) Log.w(TAG, "DtvCcPacket ended prematurely; size is " + (currentDtvCcPacket.packetSize * 2 - 1)
+ ", but current index is " + currentDtvCcPacket.currentIndex + " (sequence number " + ", but current index is " + currentDtvCcPacket.currentIndex + " (sequence number "
+ currentDtvCcPacket.sequenceNumber + ")"); + currentDtvCcPacket.sequenceNumber + "); ignoring packet");
return;
} }
serviceBlockPacket.reset(currentDtvCcPacket.packetData, currentDtvCcPacket.currentIndex); serviceBlockPacket.reset(currentDtvCcPacket.packetData, currentDtvCcPacket.currentIndex);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment