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}
This commit is contained in:
committed by
Commit Bot
parent
dabdde6273
commit
4970670c78
@ -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];
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ rtc_static_library("vad") {
|
||||
}
|
||||
|
||||
if (rtc_include_tests) {
|
||||
rtc_static_library("vad_unittests") {
|
||||
rtc_source_set("vad_unittests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"gmm_unittest.cc",
|
||||
|
||||
Reference in New Issue
Block a user