[FFmpeg-cvslog] Revert "avfilter/vf_framerate: if metadata lavfi.scd.mafd exists, we'll use it first"

Marton Balint git at videolan.org
Fri May 15 19:41:58 EEST 2020


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Thu May 14 22:49:01 2020 +0200| [b4bcae4e0e9afee734b7d9d80fd350bc27d88cea] | committer: Marton Balint

Revert "avfilter/vf_framerate: if metadata lavfi.scd.mafd exists, we'll use it first"

This reverts commit 339593ca90cb3e05d659ec99a1479904ec742294.

Fixes null pointer dereference.

Signed-off-by: Marton Balint <cus at passwd.hu>

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

 libavfilter/vf_framerate.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/libavfilter/vf_framerate.c b/libavfilter/vf_framerate.c
index 8d16998457..6c8d01c94b 100644
--- a/libavfilter/vf_framerate.c
+++ b/libavfilter/vf_framerate.c
@@ -71,20 +71,13 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *crnt, AVFrame *next
 
     if (crnt->height == next->height &&
         crnt->width  == next->width) {
-        AVDictionaryEntry *e_mafd = NULL;
         uint64_t sad;
-        double mafd = HUGE_VAL, diff;
-        char *tail = NULL;
+        double mafd, diff;
 
         ff_dlog(ctx, "get_scene_score() process\n");
-        e_mafd = av_dict_get(next->metadata, "lavfi.scd.mafd", NULL, AV_DICT_MATCH_CASE);
-        if (e_mafd)
-            mafd = strtod(e_mafd->value, &tail);
-        if (*tail || mafd == HUGE_VAL) {
-            s->sad(crnt->data[0], crnt->linesize[0], next->data[0], next->linesize[0], crnt->width, crnt->height, &sad);
-            emms_c();
-            mafd = (double)sad * 100.0 / (crnt->width * crnt->height) / (1 << s->bitdepth);
-        }
+        s->sad(crnt->data[0], crnt->linesize[0], next->data[0], next->linesize[0], crnt->width, crnt->height, &sad);
+        emms_c();
+        mafd = (double)sad * 100.0 / (crnt->width * crnt->height) / (1 << s->bitdepth);
         diff = fabs(mafd - s->prev_mafd);
         ret  = av_clipf(FFMIN(mafd, diff), 0, 100.0);
         s->prev_mafd = mafd;



More information about the ffmpeg-cvslog mailing list