From 605c2b156b4d80c4203c3c167b02c4351f8985f1 Mon Sep 17 00:00:00 2001 From: martynshaw99 Date: Mon, 26 Sep 2011 23:36:07 +0000 Subject: [PATCH] Revert r11264 since it prevents more than one simpleblockfile per project (see http://bugzilla.audacityteam.org/show_bug.cgi?id=451#c9 but ref 11264, not 11267). Add an assert on writing over-long sequences (there may be more places this should be done). --- src/Sequence.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Sequence.cpp b/src/Sequence.cpp index 1efcb5b8c..4deb1ee5e 100644 --- a/src/Sequence.cpp +++ b/src/Sequence.cpp @@ -789,14 +789,7 @@ bool Sequence::HandleXMLTag(const wxChar *tag, const wxChar **attrs) mSampleFormat = (sampleFormat)nValue; } else if (!wxStrcmp(attr, wxT("numsamples"))) - { - if (nValue > mMaxSamples) // Disallow "numsamples" tag value > "maxsamples" tag value - { - mErrorOpening = true; - return false; - } mNumSamples = nValue; - } } // while //// Both mMaxSamples and mSampleFormat should have been set. @@ -881,6 +874,8 @@ void Sequence::WriteXML(XMLWriter &xmlFile) for (b = 0; b < mBlock->Count(); b++) { SeqBlock *bb = mBlock->Item(b); + wxASSERT(bb->f->GetLength() <= mMaxSamples); // it has been reported that this has been seen in aup files, see bug 451 + xmlFile.StartTag(wxT("waveblock")); xmlFile.WriteAttr(wxT("start"), bb->start);