diff --git a/ChangeLog b/ChangeLog index 6aa352dfc..f035f63dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2007-08-04 Tobias Doerffel + * plugins/audio_file_processor/audio_file_processor.cpp: + * plugins/bit_invader/bit_invader.cpp: + * plugins/kicker/kicker.cpp: + * plugins/lb302/lb302.cpp: + * plugins/patman/patman.cpp: + * plugins/plucked_string_synth/plucked_string_synth.cpp: + * plugins/polyb302/polyb302.cpp: + * plugins/singerbot/singerbot.cpp: + * plugins/stk/mallets/mallets.cpp: + * plugins/vibed/vibed.cpp: + added check for framesLeftForCurrentPeriod() being zero - fixes + segfault in some cases + * src/tracks/instrument_track.cpp: - do not simply pass-through _frames-parameter, use notePlayHandle::framesLeftForCurrentPeriod() if possible diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 203380929..1dd090318 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -392,6 +392,10 @@ void audioFileProcessor::setAudioFile( const QString & _audio_file, bool _rename void audioFileProcessor::playNote( notePlayHandle * _n, bool ) { const fpp_t frames = _n->framesLeftForCurrentPeriod(); + if( frames == 0 ) + { + return; + } sampleFrame * buf = new sampleFrame[frames]; if( !_n->m_pluginData ) diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index a181e1878..e7c698e74 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -702,6 +702,10 @@ void bitInvader::playNote( notePlayHandle * _n, bool ) } const fpp_t frames = _n->framesLeftForCurrentPeriod(); + if( frames == 0 ) + { + return; + } sampleFrame * buf = new sampleFrame[frames]; bSynth * ps = static_cast( _n->m_pluginData ); diff --git a/plugins/kicker/kicker.cpp b/plugins/kicker/kicker.cpp index 2b21c0a3e..e8484a9a7 100644 --- a/plugins/kicker/kicker.cpp +++ b/plugins/kicker/kicker.cpp @@ -199,6 +199,10 @@ void kickerInstrument::playNote( notePlayHandle * _n, bool ) : engine::getMixer()->framesPerAudioBuffer();*/ const fpp_t frames = _n->framesLeftForCurrentPeriod(); + if( frames == 0 ) + { + return; + } const float f1 = m_startFreqKnob->value() + tfp * fdiff / decfr; const float f2 = m_startFreqKnob->value() + (frames+tfp-1)*fdiff/decfr; diff --git a/plugins/lb302/lb302.cpp b/plugins/lb302/lb302.cpp index 1e4a5e09c..705fda33f 100644 --- a/plugins/lb302/lb302.cpp +++ b/plugins/lb302/lb302.cpp @@ -739,6 +739,10 @@ void lb302Synth::playNote( notePlayHandle * _n, bool ) } const fpp_t frames = _n->framesLeftForCurrentPeriod(); + if( frames == 0 ) + { + return; + } sampleFrame *buf = new sampleFrame[frames]; process(buf, frames); diff --git a/plugins/organic/organic.cpp b/plugins/organic/organic.cpp index 245162221..a26565239 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -360,6 +360,10 @@ void organicInstrument::playNote( notePlayHandle * _n, bool ) )->oscRight; const fpp_t frames = _n->framesLeftForCurrentPeriod(); + if( frames == 0 ) + { + return; + } sampleFrame * buf = new sampleFrame[frames]; osc_l->update( buf, frames, 0 ); diff --git a/plugins/patman/patman.cpp b/plugins/patman/patman.cpp index 3081b1219..a371615fe 100644 --- a/plugins/patman/patman.cpp +++ b/plugins/patman/patman.cpp @@ -214,6 +214,10 @@ QString patmanSynth::nodeName( void ) const void patmanSynth::playNote( notePlayHandle * _n, bool ) { const fpp_t frames = _n->framesLeftForCurrentPeriod(); + if( frames == 0 ) + { + return; + } sampleFrame * buf = new sampleFrame[frames]; if( !_n->m_pluginData ) diff --git a/plugins/plucked_string_synth/plucked_string_synth.cpp b/plugins/plucked_string_synth/plucked_string_synth.cpp index 0e18c4a7c..e27937c65 100644 --- a/plugins/plucked_string_synth/plucked_string_synth.cpp +++ b/plugins/plucked_string_synth/plucked_string_synth.cpp @@ -144,6 +144,10 @@ void pluckedStringSynth::playNote( notePlayHandle * _n, bool ) } const fpp_t frames = _n->framesLeftForCurrentPeriod(); + if( frames == 0 ) + { + return; + } sampleFrame * buf = new sampleFrame[frames]; pluckSynth * ps = static_cast( _n->m_pluginData ); diff --git a/plugins/polyb302/polyb302.cpp b/plugins/polyb302/polyb302.cpp index 6c0cc0996..32e3380d4 100644 --- a/plugins/polyb302/polyb302.cpp +++ b/plugins/polyb302/polyb302.cpp @@ -552,6 +552,10 @@ void polyb302Synth::playNote( notePlayHandle * _n, bool ) } const fpp_t frames = _n->framesLeftForCurrentPeriod(); + if( frames == 0 ) + { + return; + } sampleFrame * buf = new sampleFrame[frames]; hstate->process( buf, frames, _n->frequency() ); diff --git a/plugins/singerbot/singerbot.cpp b/plugins/singerbot/singerbot.cpp index d7a6fdf73..d74bcf56f 100644 --- a/plugins/singerbot/singerbot.cpp +++ b/plugins/singerbot/singerbot.cpp @@ -146,6 +146,10 @@ singerBot::~singerBot() void singerBot::playNote( notePlayHandle * _n, bool ) { const fpp_t frames = _n->framesLeftForCurrentPeriod(); + if( frames == 0 ) + { + return; + } if( !_n->m_pluginData ) { diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index f2ef32b56..dcca1a39c 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -442,6 +442,10 @@ void mallets::playNote( notePlayHandle * _n, bool ) } const fpp_t frames = _n->framesLeftForCurrentPeriod(); + if( frames == 0 ) + { + return; + } malletsSynth * ps = static_cast( _n->m_pluginData ); sample_t add_scale = 0.0f; diff --git a/plugins/triple_oscillator/triple_oscillator.cpp b/plugins/triple_oscillator/triple_oscillator.cpp index 8e3dfc316..bb83e8fce 100644 --- a/plugins/triple_oscillator/triple_oscillator.cpp +++ b/plugins/triple_oscillator/triple_oscillator.cpp @@ -687,6 +687,10 @@ void tripleOscillator::playNote( notePlayHandle * _n, bool ) )->oscRight; const fpp_t frames = _n->framesLeftForCurrentPeriod(); + if( frames == 0 ) + { + return; + } sampleFrame * buf = new sampleFrame[frames]; osc_l->update( buf, frames, 0 ); diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index 3a0cb6494..b975f183e 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -576,6 +576,10 @@ void vibed::playNote( notePlayHandle * _n, bool ) } const fpp_t frames = _n->framesLeftForCurrentPeriod(); + if( frames == 0 ) + { + return; + } stringContainer * ps = static_cast( _n->m_pluginData );