[FFmpeg-cvslog] avfilter/af_drmeter: Check that there is data

Michael Niedermayer git at videolan.org
Wed Sep 8 22:43:21 EEST 2021


ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Sat Jun  5 20:28:24 2021 +0200| [ebc5ea216f3ab12551eecb2ceee15bb868298208] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit 4f49fa6abe89e2fca2585cac4c63190315972cf0)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ebc5ea216f3ab12551eecb2ceee15bb868298208
---

 libavfilter/af_drmeter.c | 5 +++++
 1 file changed, 5 insertions(+)

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++) {



More information about the ffmpeg-cvslog mailing list