[pulseaudio-discuss] [PATCH] smoother-test: Fix array overflow.

Tanu Kaskinen tanu.kaskinen at digia.com
Fri Mar 30 00:31:48 PDT 2012


---
 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



More information about the pulseaudio-discuss mailing list