SampleBuffer: more sanity checks in getSampleFragment()
Despite of the previously introduced sanitizing it still sometimes happens that an end frame variable is not greater than the corresponding start frame variable. Make sure we don't crash by adding more sanity checks in getSampleFragment(). Closes #629.
This commit is contained in:
@@ -752,14 +752,14 @@ sampleFrame * SampleBuffer::getSampleFragment( f_cnt_t _start,
|
||||
{
|
||||
if( _looped )
|
||||
{
|
||||
if( _start + _frames <= m_loopEndFrame )
|
||||
if( _start + _frames <= m_loopEndFrame || m_loopStartFrame >= m_loopEndFrame )
|
||||
{
|
||||
return m_data + _start;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( _start + _frames <= m_endFrame )
|
||||
if( _start + _frames <= m_endFrame || m_startFrame >= m_endFrame )
|
||||
{
|
||||
return m_data + _start;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user