1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 08:39:46 +02:00

Fix a null dereference found by Pvs-studio...

... I think the other examples flagged by it are provably redundant
null-checks after uses of pointers, not really bugs
This commit is contained in:
Paul Licameli 2017-10-11 23:07:12 -04:00
parent 31b820b47c
commit 1960762308

View File

@ -4090,14 +4090,15 @@ void AudacityProject::AddImportedTracks(const wxString &fileName,
// remember this to show a warning later
if (newTrack->GetKind() == WaveTrack::Wave)
{
WaveClip* clip = ((WaveTrack*)newTrack)->GetClipByIndex(0);
BlockArray &blocks = clip->GetSequence()->GetBlockArray();
if (clip && blocks.size())
{
SeqBlock& block = blocks[0];
if (block.f->IsAlias())
if (WaveClip* clip = ((WaveTrack*)newTrack)->GetClipByIndex(0)) {
BlockArray &blocks = clip->GetSequence()->GetBlockArray();
if (blocks.size())
{
mImportedDependencies = true;
SeqBlock& block = blocks[0];
if (block.f->IsAlias())
{
mImportedDependencies = true;
}
}
}
}