summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hurst <jhurst@cinecert.com>2019-06-28 10:08:16 -0700
committerGitHub <noreply@github.com>2019-06-28 10:08:16 -0700
commit59fbed4c8acbc1c5c109a1813dbdde429908aaf0 (patch)
tree4ee678dc18c709ad358f3dff16317d6150272d95 /src
parent60f007fef43008c71ea24f2f754eb4d3856e8130 (diff)
parent71d73ebe4a843adb93ddb2e5028ed04cc677b8ed (diff)
Merge pull request #9 from dcbullock/masterrel_2_10_33
HMAC sequence counting fix.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/AS_DCP_internal.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/AS_DCP_internal.h b/src/AS_DCP_internal.h
index 83272c0..57ed006 100755
--- a/src/AS_DCP_internal.h
+++ b/src/AS_DCP_internal.h
@@ -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 )