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:
Tobias Doerffel
2014-04-30 11:34:34 +02:00
parent 09fb597af4
commit d58a4d8804

View File

@@ -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;
}