From: Mike Brady Date: Mon, 20 May 2019 08:40:25 +0000 (+0100) Subject: fix another harmless (?) possible divide by zero X-Git-Tag: 3.3~1^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2c6b8f5373c1d28249ac123b4cf0d346d4a56bd;p=thirdparty%2Fshairport-sync.git fix another harmless (?) possible divide by zero --- diff --git a/player.c b/player.c index 021e37d2..b64dbf51 100644 --- a/player.c +++ b/player.c @@ -1520,7 +1520,7 @@ int stuff_buffer_soxr_32(int32_t *inptr, int32_t *scratchBuffer, int length, debug(2, "soxr_oneshot execution time in microseconds: mean, standard deviation and max " "for %" PRId32 " interpolations in the last " "1250 packets. %10.1f, %10.1f, %10.1f.", - stat_n, stat_mean, sqrtf(stat_M2 / (stat_n - 1)), longest_soxr_execution_time_us); + stat_n, stat_mean, stat_n <= 1 ? 0.0 : sqrtf(stat_M2 / (stat_n - 1)), longest_soxr_execution_time_us); stat_n = 0; stat_mean = 0.0; stat_M2 = 0.0;