stats/rate_hist,show_histogram: fix crash w/0 buckets
this can occur if 0 frames are encoded, e.g., due to --skip
Bug: aomedia:3243
Change-Id: I75e1deeb55909192453c41c1a716940a48c12d96
diff --git a/stats/rate_hist.c b/stats/rate_hist.c
index baf6e28..ae76fda 100644
--- a/stats/rate_hist.c
+++ b/stats/rate_hist.c
@@ -197,7 +197,9 @@
int width1, width2;
int i;
+ if (!buckets) return;
assert(bucket != NULL);
+ assert(buckets > 0);
switch ((int)(log(bucket[buckets - 1].high) / log(10)) + 1) {
case 1: