rate_hist,show_histogram: fix crash w/0 buckets

this can occur if 0 frames are encoded, e.g., due to --skip

see also: https://crbug.com/aomedia/3243

Change-Id: I791d5ad6611dbcb60d790e6b705298328ec48126
This commit is contained in:
James Zern
2022-04-11 11:08:12 -07:00
parent 6e1b7c6c14
commit d04f78b563

View File

@@ -196,7 +196,9 @@ static void show_histogram(const struct hist_bucket *bucket, int buckets,
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: