Skip to content

Commit

Permalink
rate_hist,show_histogram: fix crash w/0 buckets
Browse files Browse the repository at this point in the history
this can occur if 0 frames are encoded, e.g., due to --skip

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

Change-Id: I791d5ad6611dbcb60d790e6b705298328ec48126
  • Loading branch information
jzern committed Apr 11, 2022
1 parent 6e1b7c6 commit d04f78b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rate_hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d04f78b

Please sign in to comment.