From 337578b1ce5eb81da3b329f94acb580174eceb67 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 30 Oct 2007 17:56:32 +0000 Subject: [PATCH] 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/branches/lmms/stable-0.3@572 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 7 +++++++ configure.in | 5 +++-- src/core/note_play_handle.cpp | 12 +++++++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index fa41b2dea..9379cdde9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-10-30 Tobias Doerffel + + * src/core/note_play_handle.cpp: + fixed crash in case of framesLeft() being less or equal zero while + instrument::playNote is being called (e.g. when decreasing release + while a note is active) + 2007-10-08 Tobias Doerffel merged some of Javiers recent changes to trunk: diff --git a/configure.in b/configure.in index 683563424..51b5ec777 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.3.0-svn20071008, lmms-devel/at/lists/dot/sf/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.3.0-svn20071008) +AC_INIT(lmms, 0.3.0-svn20071030, lmms-devel/at/lists/dot/sf/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.3.0-svn20071030) AM_CONFIG_HEADER(config.h) @@ -657,6 +657,7 @@ AC_CONFIG_FILES([Makefile plugins/organic/Makefile plugins/patman/Makefile plugins/singerbot/Makefile + plugins/stereo_enhancer/Makefile plugins/stk/Makefile plugins/stk/mallets/Makefile plugins/triple_oscillator/Makefile diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index 6e1f3f870..0aaed5906 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -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 ) {