From 6adc9f90625b73f2843978f720198bbb0b8057b1 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 22 Aug 2017 08:38:16 -0400 Subject: [PATCH] Fix silly out of bounds mistake in Sequence consistency check --- src/Sequence.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Sequence.cpp b/src/Sequence.cpp index 1c04523fe..159d93b41 100644 --- a/src/Sequence.cpp +++ b/src/Sequence.cpp @@ -1810,13 +1810,13 @@ void Sequence::ConsistencyCheck // gives a little more discrimination InconsistencyException ex; + unsigned int numBlocks = mBlock.size(); + unsigned int i; - sampleCount pos = mBlock[from].start; + sampleCount pos = from < numBlocks ? mBlock[from].start : mNumSamples; if ( from == 0 && pos != 0 ) ex = CONSTRUCT_INCONSISTENCY_EXCEPTION, bError = true; - unsigned int numBlocks = mBlock.size(); - for (i = from; !bError && i < numBlocks; i++) { const SeqBlock &seqBlock = mBlock[i]; if (pos != seqBlock.start)