1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-29 23:19:28 +02:00

Fix silly out of bounds mistake in Sequence consistency check

This commit is contained in:
Paul Licameli 2017-08-22 08:38:16 -04:00
parent 8342b1e026
commit 6adc9f9062

View File

@ -1810,13 +1810,13 @@ void Sequence::ConsistencyCheck
// gives a little more discrimination // gives a little more discrimination
InconsistencyException ex; InconsistencyException ex;
unsigned int numBlocks = mBlock.size();
unsigned int i; unsigned int i;
sampleCount pos = mBlock[from].start; sampleCount pos = from < numBlocks ? mBlock[from].start : mNumSamples;
if ( from == 0 && pos != 0 ) if ( from == 0 && pos != 0 )
ex = CONSTRUCT_INCONSISTENCY_EXCEPTION, bError = true; ex = CONSTRUCT_INCONSISTENCY_EXCEPTION, bError = true;
unsigned int numBlocks = mBlock.size();
for (i = from; !bError && i < numBlocks; i++) { for (i = from; !bError && i < numBlocks; i++) {
const SeqBlock &seqBlock = mBlock[i]; const SeqBlock &seqBlock = mBlock[i];
if (pos != seqBlock.start) if (pos != seqBlock.start)