fixed crash in case of framesLeft() being less or equal zero while instrument::playNote is being called

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@573 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2007-10-30 17:57:41 +00:00
parent 97833673b3
commit 175c123ce0
3 changed files with 18 additions and 5 deletions

View File

@@ -169,10 +169,16 @@ void notePlayHandle::play( bool _try_parallelizing )
>= m_frames )
{
noteOff( m_frames - m_totalFramesPlayed );
}
}
// play note!
m_instrumentTrack->playNote( this, _try_parallelizing );
// under some circumstances we're called even if there's nothing to play
// therefore do an additional check which fixes crash e.g. when
// decreasing release of an instrument-track while the note is active
if( framesLeft() > 0 )
{
// play note!
m_instrumentTrack->playNote( this, _try_parallelizing );
}
if( m_released == TRUE )
{