]> granicus.if.org Git - libvpx/commitdiff
Prevent dividing by 0 when target-bitrate is 0.
authorDebargha Mukherjee <debargha@google.com>
Mon, 8 Jun 2015 23:18:14 +0000 (16:18 -0700)
committerDebargha Mukherjee <debargha@google.com>
Mon, 8 Jun 2015 23:19:13 +0000 (16:19 -0700)
Change-Id: I05b7fb378b6b0c5f263e7839f96ba6830ee34fd2

rate_hist.c

index 1cef19bdd6429decc926bf8c5fe50d0637c6faa9..a77222b16186644caceb6d0ba2c5c08eeee76329 100644 (file)
@@ -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 */