aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJamie Bullock <jamie@jamiebullock.com>2014-03-11 18:16:12 +0000
committerJamie Bullock <jamie@jamiebullock.com>2014-03-11 18:16:12 +0000
commit7ff52fb561fae91b83ba5b95436b38d3021a44b4 (patch)
treebcc4f82dfdd69c9eebc55dc5366e0c163758b3ea /src
parentc7e8efcbea13ca27f1b6f5619f05e1f79d36ba55 (diff)
downloadLibXtract-7ff52fb561fae91b83ba5b95436b38d3021a44b4.tar.gz
LibXtract-7ff52fb561fae91b83ba5b95436b38d3021a44b4.tar.bz2
LibXtract-7ff52fb561fae91b83ba5b95436b38d3021a44b4.zip
Add range check
Diffstat (limited to 'src')
-rw-r--r--src/scalar.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/scalar.c b/src/scalar.c
index 4ae3f16..0e3578f 100644
--- a/src/scalar.c
+++ b/src/scalar.c
@@ -992,6 +992,11 @@ int xtract_midicent(const double *data, const int N, const void *argv, double *r
note *= 100;
note = round(note);
+ if (note > 12700 || note < 0)
+ {
+ return XTRACT_ARGUMENT_ERROR;
+ }
+
return XTRACT_SUCCESS;
}