Skip to content

Commit 59fbed4

Browse files
authored
Merge pull request #9 from dcbullock/master
HMAC sequence counting fix.
2 parents 60f007f + 71d73eb commit 59fbed4

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/AS_DCP_internal.h

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -414,17 +414,23 @@ namespace ASDCP
414414
// Count the sequence length in because this is the sequence
415415
// value needed to complete the HMAC.
416416
ASDCP::MXF::RIP::const_pair_iterator i;
417-
for ( i = m_RIP.PairArray.begin(); i != m_RIP.PairArray.end(); ++i, ++sequence )
417+
for ( i = m_RIP.PairArray.begin(); i != m_RIP.PairArray.end(); ++i)
418418
{
419-
if ( sid == i->BodySID )
420-
{
421-
start_offset = i->ByteOffset;
422-
}
423-
else if ( start_offset != 0 )
424-
{
425-
end_offset = i->ByteOffset;
426-
break;
427-
}
419+
if ( sid == i->BodySID )
420+
{
421+
assert( start_offset == 0);
422+
start_offset = i->ByteOffset;
423+
}
424+
else if ( start_offset != 0 )
425+
{
426+
end_offset = i->ByteOffset;
427+
break;
428+
}
429+
430+
if ( i->BodySID > 0 )
431+
{
432+
++sequence;
433+
}
428434
}
429435

430436
if ( start_offset == 0 || end_offset == 0 )

0 commit comments

Comments
 (0)