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

Tanu Kaskinen tanuk at iki.fi
Sat Dec 15 23:28:09 PST 2012


On Fri, 2012-03-30 at 10:31 +0300, Tanu Kaskinen wrote:
> ---
>  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));

This is now applied.

-- 
Tanu



More information about the pulseaudio-discuss mailing list