From: Jaroslav Kysela Date: Mon, 10 Dec 2018 08:25:51 +0000 (+0100) Subject: tprofile: fix possible division by zero X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfc8315a1018a32678ce6aab6023d3bda737a3fe;p=thirdparty%2Ftvheadend.git tprofile: fix possible division by zero --- diff --git a/src/tprofile.c b/src/tprofile.c index dc8b40156..5d9aeaacb 100644 --- a/src/tprofile.c +++ b/src/tprofile.c @@ -235,6 +235,7 @@ static void qprofile_log_qstats(void) qprof_next = LIST_NEXT(qprof, link); if (qprof->changed == 0) continue; diff = qprof->tstamp ? mono - qprof->tstamp : 1; + if (diff == 0) diff = 1; tvhtrace(LS_QPROF, "%s: max/avg/cnt/drop/dropcnt=%" PRIu64"/%"PRIu64"/%"PRIu64"/%"PRIu64"/%"PRIu64 " (max=%s -%"PRId64"sec) BW=%"PRId64"%s",