Skip to content

Commit

Permalink
DORIS-1710: Respect the advertised packet size in the CEA708 decoder (#…
Browse files Browse the repository at this point in the history
…75)

* DORIS-1710: Respect the advertised packet size, otherwise the decoding will fail if the packet has less data as advertised.

* DORIS-1710: Remove TODO
  • Loading branch information
szaboa authored Mar 7, 2023
1 parent 33b5693 commit 253fd43
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ private void processCurrentPacket() {
// exhausted. On each iteration we process a single service block. If the block has a service
// number different to the currently selected service, then we skip it and continue with the
// next service block.
captionChannelPacketData.reset(currentDtvCcPacket.packetData, currentDtvCcPacket.currentIndex);

// Fix for https://dicetech.atlassian.net/browse/DORIS-1710.
captionChannelPacketData.reset(currentDtvCcPacket.packetData, (currentDtvCcPacket.packetSize * 2 - 1));
//captionChannelPacketData.reset(currentDtvCcPacket.packetData, currentDtvCcPacket.currentIndex);
while (captionChannelPacketData.bitsLeft() > 0) {
// Parse the Standard Service Block Header (see CEA-708B 6.2.1)
int serviceNumber = captionChannelPacketData.readBits(3);
Expand Down

0 comments on commit 253fd43

Please sign in to comment.