diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-06-05 20:28:24 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-09 13:54:52 +0200 |
commit | d71d3cc9f6bc3012c06e7b6ef7215b1857242a0d (patch) | |
tree | 5dbff3b20d9c57e0071df36d2c5e4e75f4c9c2b5 | |
parent | 6ce4989432d6ac71ad05c5e82f551545258c0b3e (diff) | |
download | ffmpeg-d71d3cc9f6bc3012c06e7b6ef7215b1857242a0d.tar.gz |
avfilter/af_drmeter: Check that there is data
Fixes: floating point division by 0
Fixes: -nan is outside the range of representable values of type 'int'
Fixes: Ticket8307
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4f49fa6abe89e2fca2585cac4c63190315972cf0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavfilter/af_drmeter.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavfilter/af_drmeter.c b/libavfilter/af_drmeter.c index ecccb65186..425c25ae87 100644 --- a/libavfilter/af_drmeter.c +++ b/libavfilter/af_drmeter.c @@ -167,6 +167,11 @@ static void print_stats(AVFilterContext *ctx) float chdr, secondpeak, rmssum = 0; int i, j, first = 0; + if (!p->nb_samples) { + av_log(ctx, AV_LOG_INFO, "No data, dynamic range not meassurable\n"); + return; + } + finish_block(p); for (i = 0; i <= 10000; i++) { |