lmms
lmms copied to clipboard
Clean up computation of "from" and "to" values in AudioFileProcessorWaveView
Pull request #7071 has fixed a crash that was reported in #7068 by adding safety checks via two new setter methods in plugins/AudioFileProcessor/AudioFileProcessorWaveView.h.
While the crash is gone there is still code that tries to set the "from" and "to" values to invalid values. One such method is AudioFileProcessorWaveView::slide. To fix this adjust the two new setters as follows:
void AudioFileProcessorWaveView::setTo(f_cnt_t to)
{
assert (to <= m_sample->sampleSize());
m_to = std::min(to, static_cast<lmms::f_cnt_t>(m_sample->sampleSize()));
}
void AudioFileProcessorWaveView::setFrom(f_cnt_t from)
{
assert (from >= 0);
m_from = std::max(from, 0);
}
Then follow these steps:
- Add an AFP and open it's view.
- Drag a sample onto the sample view of the AFP, e.g.
drums/clap01.oggfrom the factory samples. - Click with the left mouse button on the sample display and drag to the right until the crash occurs.