projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
44d7cb7
)
mathutils.c: fix invalid read in vec_moving_thres
author
Paul Brossier
<piem@piem.org>
Sat, 24 Nov 2007 16:25:56 +0000
(17:25 +0100)
committer
Paul Brossier
<piem@piem.org>
Sat, 24 Nov 2007 16:25:56 +0000
(17:25 +0100)
src/mathutils.c
patch
|
blob
|
history
diff --git
a/src/mathutils.c
b/src/mathutils.c
index f82549a6dda9dbfec2e90fd7cb1338cb74c9f854..70797ecc5237b11437f3ec188372a12dedf44b76 100644
(file)
--- a/
src/mathutils.c
+++ b/
src/mathutils.c
@@
-226,9
+226,9
@@
smpl_t vec_moving_thres(fvec_t * vec, fvec_t * tmpvec,
medar[k] = vec->data[0][k+pos-post];
/* pre part of the buffer does not exist */
} else {
- for (k=0;k<length-pos+post
+1
;k++)
+ for (k=0;k<length-pos+post;k++)
medar[k] = vec->data[0][k+pos-post];
- for (k=length-pos+post
+1
;k<win_length;k++)
+ for (k=length-pos+post;k<win_length;k++)
medar[k] = 0.; /* 0-padding at the end */
}
return vec_median(tmpvec);