shithub: libvpx

Download patch

ref: c23a9e218c8d8bbcae2c153d1da5406bbdc24467
parent: b19b16cfa1fe0275c82dadc78c4dcbb8a1f8da36
author: Debargha Mukherjee <[email protected]>
date: Mon Jun 8 12:18:14 EDT 2015

Prevent dividing by 0 when target-bitrate is 0.

Change-Id: I05b7fb378b6b0c5f263e7839f96ba6830ee34fd2

--- a/rate_hist.c
+++ b/rate_hist.c
@@ -88,6 +88,9 @@
   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 */