From 0f3851d597d5a913f13f4455a475dfd196991022 Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Tue, 11 Jun 2013 13:11:59 +0200 Subject: [PATCH] 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. --- plugins/audio_file_processor/audio_file_processor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 729e9e429..5520c7302 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -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 ); + } }