aboutsummaryrefslogtreecommitdiff
path: root/common_audio
diff options
context:
space:
mode:
authorHenrik Lundin <henrik.lundin@webrtc.org>2019-10-17 10:37:42 +0200
committerCommit Bot <commit-bot@chromium.org>2019-10-17 10:59:49 +0000
commit4970670c78efdf64048874c3bd34b3ebca7e65e7 (patch)
tree97c67c6be59ad24e6affbd119d0c58911b0e9e8c /common_audio
parentdabdde62738da8374c6f6afd4f3c3378afaccc76 (diff)
downloadwebrtc-4970670c78efdf64048874c3bd34b3ebca7e65e7.tar.gz
Avoid reading outside of memory in WebRtcVad_FindMinimum
Also, change test target from rtc_static_library to rtc_source_set so that it is actually linked and run. Bug: webrtc:11010, webrtc:11037 Change-Id: I05173718ee7de8a9fad73b62c0efd0da4d4f1a7e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157166 Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29509}
Diffstat (limited to 'common_audio')
-rw-r--r--common_audio/vad/vad_sp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common_audio/vad/vad_sp.c b/common_audio/vad/vad_sp.c
index d367c8b0af..d710a37907 100644
--- a/common_audio/vad/vad_sp.c
+++ b/common_audio/vad/vad_sp.c
@@ -79,7 +79,7 @@ int16_t WebRtcVad_FindMinimum(VadInstT* self,
age[i]++;
} else {
// Too old value. Remove from memory and shift larger values downwards.
- for (j = i; j < 16; j++) {
+ for (j = i; j < 15; j++) {
smallest_values[j] = smallest_values[j + 1];
age[j] = age[j + 1];
}