mirror of
https://github.com/miek/inspectrum.git
synced 2026-03-12 11:17:07 +01:00
fix(inputsource): Fix off-by-one in getSamples()
This commit is contained in:
@@ -187,7 +187,7 @@ std::unique_ptr<std::complex<float>[]> InputSource::getSamples(off_t start, off_
|
||||
if(start < 0 || length < 0)
|
||||
return nullptr;
|
||||
|
||||
if (start + length >= sampleCount)
|
||||
if (start + length > sampleCount)
|
||||
return nullptr;
|
||||
|
||||
std::unique_ptr<std::complex<float>[]> dest(new std::complex<float>[length]);
|
||||
|
||||
Reference in New Issue
Block a user