From 88508be0b2c0f916e348019eabf12b469eb7b9a1 Mon Sep 17 00:00:00 2001 From: milla Date: Fri, 28 May 2021 11:12:49 +0200 Subject: Add KM logs and remove semicolon from pre-processor directive --- src/Index.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/Index.cpp') diff --git a/src/Index.cpp b/src/Index.cpp index 0815f25..81ee5b4 100755 --- a/src/Index.cpp +++ b/src/Index.cpp @@ -30,9 +30,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "MXF.h" -const ui32_t kl_length = ASDCP::SMPTE_UL_LENGTH + ASDCP::MXF_BER_LENGTH; +#include "KM_log.h" +const ui32_t kl_length = ASDCP::SMPTE_UL_LENGTH + ASDCP::MXF_BER_LENGTH; +using Kumu::DefaultLogSink; // ASDCP::MXF::IndexTableSegment::IndexTableSegment(const Dictionary* d) : InterchangeObject(d), RtFileOffset(0), RtEntryOffset(0), @@ -118,10 +120,15 @@ ASDCP::MXF::IndexTableSegment::InitFromTLVSet(TLVReader& TLVSet) if ( decoder_item_size < item_size ) { - TLVSet.SkipOffset(item_size - decoder_item_size); + rc = TLVSet.SkipOffset(item_size - decoder_item_size); } } } + if (IndexEntryArray.size() != item_count) + { + DefaultLogSink().Error("Malformed index table segment, could not decode all IndexEntries.\n"); + return RESULT_FAIL; + } } } } @@ -196,7 +203,7 @@ ASDCP::MXF::IndexTableSegment::Dump(FILE* stream) } else { - fprintf(stream, " IndexEntryArray: %zu entries\n", IndexEntryArray.size()); + fprintf(stream, " IndexEntryArray: %lu entries\n", IndexEntryArray.size()); } } -- cgit v1.2.3