From c23a9e218c8d8bbcae2c153d1da5406bbdc24467 Mon Sep 17 00:00:00 2001 From: Debargha Mukherjee Date: Mon, 8 Jun 2015 16:18:14 -0700 Subject: [PATCH] Prevent dividing by 0 when target-bitrate is 0. Change-Id: I05b7fb378b6b0c5f263e7839f96ba6830ee34fd2 --- rate_hist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rate_hist.c b/rate_hist.c index 1cef19bdd..a77222b16 100644 --- a/rate_hist.c +++ b/rate_hist.c @@ -88,6 +88,9 @@ void update_rate_histogram(struct rate_hist *hist, if (now < cfg->rc_buf_initial_sz) return; + if (!cfg->rc_target_bitrate) + return; + then = now; /* Sum the size over the past rc_buf_sz ms */ -- 2.49.0