aboutsummaryrefslogtreecommitdiff
path: root/src/scalar.c
diff options
context:
space:
mode:
authorJamie Bullock <jamie@postlude.co.uk>2007-09-24 08:23:26 +0000
committerJamie Bullock <jamie@postlude.co.uk>2007-09-24 08:23:26 +0000
commit05c9f692e8a4139320b4f541e1654f7cd0fb44ec (patch)
treee8511d3139dbfb673a9f04116b8040fa7e9bc14f /src/scalar.c
parent1f22cd5a7ddd3030c0c47f0528f5b2068f6b5283 (diff)
downloadLibXtract-05c9f692e8a4139320b4f541e1654f7cd0fb44ec.tar.gz
LibXtract-05c9f692e8a4139320b4f541e1654f7cd0fb44ec.tar.bz2
LibXtract-05c9f692e8a4139320b4f541e1654f7cd0fb44ec.zip
Made xtract_loudness() more permissive, so it doesn't crash if N > BARK_BANDS
Diffstat (limited to 'src/scalar.c')
-rw-r--r--src/scalar.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/scalar.c b/src/scalar.c
index f259872..b573102 100644
--- a/src/scalar.c
+++ b/src/scalar.c
@@ -419,8 +419,10 @@ int xtract_loudness(const float *data, const int N, const void *argv, float *res
int n = N, rv;
- if(n > XTRACT_BARK_BANDS)
+ if(n > XTRACT_BARK_BANDS){
+ n = XTRACT_BARK_BANDS;
rv = XTRACT_BAD_VECTOR_SIZE;
+ }
else
rv = XTRACT_SUCCESS;