From caf33fc995f948f04549b5facb9f5d69ae91b8f8 Mon Sep 17 00:00:00 2001 From: "v.audacity" Date: Mon, 10 Oct 2011 21:26:35 +0000 Subject: [PATCH] Clarify some comments, in figuring out the cause of bug 451 (p2). --- src/Sequence.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Sequence.cpp b/src/Sequence.cpp index 614e1e54c..863606c5a 100644 --- a/src/Sequence.cpp +++ b/src/Sequence.cpp @@ -739,9 +739,17 @@ bool Sequence::HandleXMLTag(const wxChar *tag, const wxChar **attrs) if (!wxStrcmp(attr, wxT("start"))) wb->start = nValue; + // Vaughan, 2011-10-10: I don't think we ever write a "len" attribute for "waveblock" tag, + // so I think this is actually legacy code, or something intended, but not completed. + // Anyway, might as well leave this code in, especially now that it has the check + // against mMaxSamples. if (!wxStrcmp(attr, wxT("len"))) { - if (nValue > mMaxSamples) // mMaxSamples should already have been set by calls to the "sequence" clause below. + // mMaxSamples should already have been set by calls to the "sequence" clause below. + // The check intended here was already done in DirManager::HandleXMLTag(), where + // it let the block be built, then checked against mMaxSamples, and deleted the block + // if the size of the block is bigger than mMaxSamples. + if (nValue > mMaxSamples) { delete (wb); mErrorOpening = true;