summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordbullock <dbullock@cinecert.com>2019-06-14 15:30:13 -0700
committerdbullock <dbullock@cinecert.com>2019-06-28 09:35:51 -0700
commit5000f665e035e3ced7f190aca715de8d3288a6b2 (patch)
tree9e1ff65fe6314dd02b1d8b9d24307d895335767e /src
parent00da02605a461f0ebc59d398a67ec38afa340c0b (diff)
Fix HMAC sequence count on MXF read.
This fixes #4.
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 )