AudioFileProcessor: fix crash with reversed samples

AudioFileProcessorWaveView::slideSampleByFrames() gets called before the
knobs are created and/or after they are destroyed if the sample is
reversed. Added checks for nonexistant knobs.

Closes Patch #41 and Bug #525.
This commit is contained in:
Raine M. Ekman
2013-06-11 13:11:59 +02:00
committed by Tobias Doerffel
parent e29de773b3
commit 0f3851d597

View File

@@ -932,8 +932,12 @@ void AudioFileProcessorWaveView::slideSampleByFrames( f_cnt_t _frames )
return;
}
const double v = double( _frames ) / m_sampleBuffer.frames();
m_startKnob->slideBy( v, false );
m_endKnob->slideBy( v, false );
if(m_startKnob) {
m_startKnob->slideBy( v, false );
}
if(m_endKnob) {
m_endKnob->slideBy( v, false );
}
}