fix potential overruns on sample preview

master
zetaPRIME 2022-03-22 22:23:31 -04:00
parent 0a14aec9e5
commit acbca4ae0b
2 changed files with 2 additions and 2 deletions

2
notes
View File

@ -35,7 +35,7 @@ TODO {
about-license info
}
fix overrun-by-1 on sample preview
- fix overrun-by-1 on sample preview
templatize svfilter and have mono version for synth use

View File

@ -35,7 +35,7 @@ using namespace Xybrid::Data;
std::array<float, 2> Sample::plotBetween(size_t ch, size_t start, size_t end) const {
if (end < start) end = start;
if (ch >= 2 || start >= data[ch].size()) return {0, 0};
end = std::min(end, data[ch].size());
end = std::min(end, data[ch].size()-1);
float mx = -100;
float mn = 100;