avfilter/af_astats: Avoid Zero division in print part.
authorMartin Vignali <martin.vignali@gmail.com>
Sun, 8 Mar 2015 08:41:27 +0000 (08:41 +0000)
committerPaul B Mahol <onemda@gmail.com>
Sun, 8 Mar 2015 08:47:27 +0000 (08:47 +0000)
libavfilter/af_astats.c

index 60ccd73..3ac2749 100644 (file)
@@ -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);