aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorMartin Vignali <martin.vignali@gmail.com>2015-03-08 08:41:27 +0000
committerPaul B Mahol <onemda@gmail.com>2015-03-08 08:47:27 +0000
commit65ba90eac6fde92b078f8c012f591382b44ac88b (patch)
treea782f3885ad902f87905647a661c895940ed62c0 /libavfilter
parent9d7e42e65cfd8c521b1473b3ce1a11d73b6f56fb (diff)
downloadffmpeg-65ba90eac6fde92b078f8c012f591382b44ac88b.tar.gz
avfilter/af_astats: Avoid Zero division in print part.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/af_astats.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavfilter/af_astats.c b/libavfilter/af_astats.c
index 60ccd735e1..3ac27498bc 100644
--- a/libavfilter/af_astats.c
+++ b/libavfilter/af_astats.c
@@ -222,6 +222,9 @@ static void print_stats(AVFilterContext *ctx)
av_log(ctx, AV_LOG_INFO, "Peak count: %"PRId64"\n", p->min_count + p->max_count);
}
+ if (!nb_samples || !s->nb_channels)
+ return;
+
av_log(ctx, AV_LOG_INFO, "Overall\n");
av_log(ctx, AV_LOG_INFO, "DC offset: %f\n", max_sigma_x / (nb_samples / s->nb_channels));
av_log(ctx, AV_LOG_INFO, "Min level: %f\n", min);