fix(inputsource): Fix off-by-one in getSamples()

This commit is contained in:
schneider
2016-09-01 22:49:13 +01:00
parent 2f5f012929
commit a487862559

View File

@@ -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]);