if ( ASDCP_SUCCESS(result) )
result = m_HeaderPart.InitFromFile(m_File);
- // if this is a three partition file, go to the body
- // partition and read off the partition pack
- if ( m_HeaderPart.m_RIP.PairArray.size() == 3 )
+ if ( ASDCP_SUCCESS(result) )
{
- Array<RIP::Pair>::iterator r_i = m_HeaderPart.m_RIP.PairArray.begin();
- r_i++;
- m_File.Seek((*r_i).ByteOffset);
+ // if this is a three partition file, go to the body
+ // partition and read the partition pack
+ if ( m_HeaderPart.m_RIP.PairArray.size() == 3 )
+ {
+ Array<RIP::Pair>::iterator r_i = m_HeaderPart.m_RIP.PairArray.begin();
+ r_i++;
+ m_File.Seek((*r_i).ByteOffset);
+
+ result = m_BodyPart.InitFromFile(m_File);
+ }
- result = m_BodyPart.InitFromFile(m_File);
+ m_EssenceStart = m_File.Tell();
}
- m_EssenceStart = m_File.Tell();
- return RESULT_OK;
+ return result;
}
if ( ASDCP_FAILURE(m_FooterPart.Lookup(FrameNum, TmpEntry)) )
{
- DefaultLogSink().Error("Frame value out of range: %lu\n", FrameNum);
+ DefaultLogSink().Error("Frame value out of range: %u\n", FrameNum);
return RESULT_RANGE;
}
if ( FrameBuf.Capacity() < SourceLength )
{
- DefaultLogSink().Error("FrameBuf.Capacity: %lu SourceLength: %lu\n", FrameBuf.Capacity(), SourceLength);
+ DefaultLogSink().Error("FrameBuf.Capacity: %u SourceLength: %u\n", FrameBuf.Capacity(), SourceLength);
return RESULT_SMALLBUF;
}
// read ESV length
if ( ! Kumu::read_test_BER(&ess_p, esv_length) )
{
- DefaultLogSink().Error("read_test_BER did not return %lu\n", esv_length);
+ DefaultLogSink().Error("read_test_BER did not return %u\n", esv_length);
return RESULT_FORMAT;
}
else // return ciphertext to caller
{
if ( FrameBuf.Capacity() < tmp_len )
- return RESULT_SMALLBUF;
+ {
+ char intbuf[IntBufferLen];
+ DefaultLogSink().Error("FrameBuf.Capacity: %u FrameLength: %s\n",
+ FrameBuf.Capacity(), ui64sz(PacketLength, intbuf));
+ return RESULT_SMALLBUF;
+ }
memcpy(FrameBuf.Data(), ess_p, tmp_len);
FrameBuf.Size(tmp_len);
if ( FrameBuf.Capacity() < PacketLength )
{
char intbuf[IntBufferLen];
- DefaultLogSink().Error("FrameBuf.Capacity: %lu FrameLength: %s\n",
+ DefaultLogSink().Error("FrameBuf.Capacity: %u FrameLength: %s\n",
FrameBuf.Capacity(), ui64sz(PacketLength, intbuf));
return RESULT_SMALLBUF;
}