AudioFileProcessor: fixed crash for samples with zero length
This is a fix for #3598536. Closes #3598536. Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
This commit is contained in:
committed by
Tobias Doerffel
parent
716146848c
commit
2960f67beb
@@ -542,7 +542,15 @@ AudioFileProcessorWaveView::AudioFileProcessorWaveView( QWidget * _parent, int _
|
||||
|
||||
void AudioFileProcessorWaveView::isPlaying( f_cnt_t _frames_played )
|
||||
{
|
||||
m_framesPlayed = _frames_played % ( m_sampleBuffer.endFrame() - m_sampleBuffer.startFrame() );
|
||||
const f_cnt_t nb_frames = m_sampleBuffer.endFrame() - m_sampleBuffer.startFrame();
|
||||
if( nb_frames < 1 )
|
||||
{
|
||||
m_framesPlayed = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_framesPlayed = _frames_played % nb_frames;
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user