[PATCH] smoother-test: Fix array overflow.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/tests/smoother-test.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/tests/smoother-test.c b/src/tests/smoother-test.c
index 4471669..d97d3f7 100644
--- a/src/tests/smoother-test.c
+++ b/src/tests/smoother-test.c
@@ -73,7 +73,8 @@ int main(int argc, char*argv[]) {
             pa_log_debug("%i\t\t%i", msec[u],  msec[u+1]);
             u += 2;
 
-            pa_smoother_resume(s, (pa_usec_t) msec[u] * PA_USEC_PER_MSEC, TRUE);
+            if (u < PA_ELEMENTSOF(msec))
+                pa_smoother_resume(s, (pa_usec_t) msec[u] * PA_USEC_PER_MSEC, TRUE);
         }
 
         pa_log_debug("%llu\t%llu", (unsigned long long) (x/PA_USEC_PER_MSEC), (unsigned long long) (pa_smoother_get(s, x)/PA_USEC_PER_MSEC));
-- 
1.7.8



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux