fix potential overruns on sample preview
parent
0a14aec9e5
commit
acbca4ae0b
2
notes
2
notes
|
@ -35,7 +35,7 @@ TODO {
|
||||||
about-license info
|
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
|
templatize svfilter and have mono version for synth use
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ using namespace Xybrid::Data;
|
||||||
std::array<float, 2> Sample::plotBetween(size_t ch, size_t start, size_t end) const {
|
std::array<float, 2> Sample::plotBetween(size_t ch, size_t start, size_t end) const {
|
||||||
if (end < start) end = start;
|
if (end < start) end = start;
|
||||||
if (ch >= 2 || start >= data[ch].size()) return {0, 0};
|
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 mx = -100;
|
||||||
float mn = 100;
|
float mn = 100;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue