Skip to content

Commit

Permalink
Don't try to clear null buffer in NotePlayHandle::play (#4545)
Browse files Browse the repository at this point in the history
This is a workaround for rare crashes when changing the tempo
while playing notes with stacking and/or arpeggio.
When playing the master note, _working_buffer is null.
Tempo change causes false positive in the check because
NotePlayHandle::resize changes m_totalFramesPlayed.
Thanks to 6fc4577, we can safely drop
the memset call.
  • Loading branch information
PhysSong committed Aug 22, 2018
1 parent 160488c commit 7f541a5
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/core/NotePlayHandle.cpp
Expand Up @@ -238,13 +238,6 @@ void NotePlayHandle::play( sampleFrame * _working_buffer )
// decreasing release of an instrument-track while the note is active
if( framesLeft() > 0 )
{
// clear offset frames if we're at the first period
// skip for single-streamed instruments, because in their case NPH::play() could be called from an IPH without a buffer argument
// ... also, they don't actually render the sound in NPH's, which is an even better reason to skip...
if( m_totalFramesPlayed == 0 && ! ( m_instrumentTrack->instrument()->flags() & Instrument::IsSingleStreamed ) )
{
memset( _working_buffer, 0, sizeof( sampleFrame ) * offset() );
}
// play note!
m_instrumentTrack->playNote( this, _working_buffer );
}
Expand Down

0 comments on commit 7f541a5

Please sign in to comment.