]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tprofile: fix possible division by zero
authorJaroslav Kysela <perex@perex.cz>
Mon, 10 Dec 2018 08:25:51 +0000 (09:25 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 10 Dec 2018 08:25:51 +0000 (09:25 +0100)
src/tprofile.c

index dc8b40156c5a7aefb145e2072e64f0e4aa6d0370..5d9aeaacb1223e9e6bb1025c7f569fcef9523f92 100644 (file)
@@ -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",