mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-30 15:18:42 +02:00
failsafe against crash per http://bugzilla.audacityteam.org/show_bug.cgi?id=367#c12
This commit is contained in:
parent
dc2d11b1d6
commit
bd55ab0ff0
@ -2570,8 +2570,17 @@ void TrackPanel::HandleSlide(wxMouseEvent & event)
|
|||||||
if (mCapturedTrack->GetKind() == Track::Wave) // Should always be true here, but make sure.
|
if (mCapturedTrack->GetKind() == Track::Wave) // Should always be true here, but make sure.
|
||||||
{
|
{
|
||||||
WaveTrack* pWaveTrack = (WaveTrack*)mCapturedTrack;
|
WaveTrack* pWaveTrack = (WaveTrack*)mCapturedTrack;
|
||||||
mCapturedClipArray[i].clip->Resample(pWaveTrack->GetRate());
|
WaveClip* pWaveClip = mCapturedClipArray[i].clip;
|
||||||
mCapturedClipArray[i].clip->MarkChanged();
|
//vvvvv FIX-ME: I think that at this point, mCapturedClipArray has
|
||||||
|
// the wrong clips if we're dragging a clip to another track, per bug 367.
|
||||||
|
// Probably, mCapturedClipArray does not match mCapturedTrack.
|
||||||
|
// Then if the mCapturedClipArray.GetCount() is wrong, pWaveClip can be NULL.
|
||||||
|
// This conditional is just a failsafe against crash on NULL deref.
|
||||||
|
if (pWaveClip)
|
||||||
|
{
|
||||||
|
pWaveClip->Resample(pWaveTrack->GetRate());
|
||||||
|
pWaveClip->MarkChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetCapturedTrack( NULL );
|
SetCapturedTrack( NULL );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user