1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00
v.audacity 2012-07-20 03:31:10 +00:00
parent 90858b2e99
commit a7a6c2b557
2 changed files with 10 additions and 3 deletions

View File

@ -1105,7 +1105,7 @@ void Envelope::GetValues(double *buffer, int bufferLen,
t += tstep;
continue;
}
// IF after after THEN last value
// IF after envelope THEN last value
if (t >= mEnv[len - 1]->t) {
buffer[b] = mEnv[len - 1]->val;
t += tstep;

View File

@ -1758,9 +1758,16 @@ void WaveTrack::GetEnvelopeValues(double *buffer, int bufferLen,
rt0 = clip->GetStartTime();
}
if (rt0+rlen*tstep > clip->GetEndTime())
if (rt0 + rlen*tstep > clip->GetEndTime())
{
rlen = clip->GetEndSample() - clip->GetStartSample();
int nClipLen = clip->GetEndSample() - clip->GetStartSample();
// This check prevents problem cited in http://bugzilla.audacityteam.org/show_bug.cgi?id=528#c11,
// Gale's cross_fade_out project, which was already corrupted by bug 528.
//vvvvv Should really be checked earlier, in reading the project, but that needs much more debugging, and
// this prevents the previous write past the buffer end, in clip->GetEnvelope() call.
if (nClipLen < rlen)
rlen = nClipLen;
}
clip->GetEnvelope()->GetValues(rbuf, rlen, rt0, tstep);
}