1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-05 06:09:47 +02:00

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).
This commit is contained in:
martynshaw99 2011-09-26 23:36:07 +00:00
parent 2acf90cb96
commit 605c2b156b

View File

@ -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);