From a487862559f41a8c140bc80138eebb31243e18c5 Mon Sep 17 00:00:00 2001 From: schneider Date: Thu, 1 Sep 2016 22:49:13 +0100 Subject: [PATCH] fix(inputsource): Fix off-by-one in getSamples() --- inputsource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inputsource.cpp b/inputsource.cpp index 6cc6049..3bf22eb 100644 --- a/inputsource.cpp +++ b/inputsource.cpp @@ -187,7 +187,7 @@ std::unique_ptr[]> 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[]> dest(new std::complex[length]);