From be5358254fa9ca0b69255cb3c82fcb05fcd4ce84 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 28 Jan 2019 11:10:36 +0100 Subject: [PATCH] decimate: avoid floating point exception --- lib/hooks/decimate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hooks/decimate.c b/lib/hooks/decimate.c index da7181df7..ae80a7cb0 100644 --- a/lib/hooks/decimate.c +++ b/lib/hooks/decimate.c @@ -72,7 +72,7 @@ static int decimate_process(struct hook *h, struct sample *smps[], unsigned *cnt int i, ok; for (i = 0, ok = 0; i < *cnt; i++) { - if (p->counter++ % p->ratio == 0) { + if (p->ratio && p->counter++ % p->ratio == 0) { struct sample *tmp; tmp = smps[ok];