Skip to content

Commit

Permalink
Merge pull request #9 from dcbullock/master
Browse files Browse the repository at this point in the history
HMAC sequence counting fix.
  • Loading branch information
jhursty authored Jun 28, 2019
2 parents 60f007f + 71d73eb commit 59fbed4
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/AS_DCP_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,17 +414,23 @@ namespace ASDCP
// Count the sequence length in because this is the sequence
// value needed to complete the HMAC.
ASDCP::MXF::RIP::const_pair_iterator i;
for ( i = m_RIP.PairArray.begin(); i != m_RIP.PairArray.end(); ++i, ++sequence )
for ( i = m_RIP.PairArray.begin(); i != m_RIP.PairArray.end(); ++i)
{
if ( sid == i->BodySID )
{
start_offset = i->ByteOffset;
}
else if ( start_offset != 0 )
{
end_offset = i->ByteOffset;
break;
}
if ( sid == i->BodySID )
{
assert( start_offset == 0);
start_offset = i->ByteOffset;
}
else if ( start_offset != 0 )
{
end_offset = i->ByteOffset;
break;
}

if ( i->BodySID > 0 )
{
++sequence;
}
}

if ( start_offset == 0 || end_offset == 0 )
Expand Down

0 comments on commit 59fbed4

Please sign in to comment.