]> code.delx.au - pulseaudio/commitdiff
smoother-test: Fix array overflow.
authorTanu Kaskinen <tanu.kaskinen@digia.com>
Fri, 30 Mar 2012 07:31:48 +0000 (10:31 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Wed, 19 Dec 2012 10:31:50 +0000 (12:31 +0200)
src/tests/smoother-test.c

index c06f96d9afcbb754b004edcf392ea0e9bf37736b..eac824e80ecfe0618bc39ead49450d35638b6829 100644 (file)
@@ -75,7 +75,8 @@ START_TEST (smoother_test) {
             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));