]> git.sesse.net Git - ffmpeg/commitdiff
Revert "avfilter/vf_minterpolate: if metadata lavfi.scd.mafd exists, we'll use it...
authorMarton Balint <cus@passwd.hu>
Thu, 14 May 2020 20:53:14 +0000 (22:53 +0200)
committerMarton Balint <cus@passwd.hu>
Fri, 15 May 2020 16:35:51 +0000 (18:35 +0200)
This reverts commit d88e1c9838dbcfe29d7835f2705ffc9ee6a36bf3.

Fixes null pointer dereference.

Signed-off-by: Marton Balint <cus@passwd.hu>
libavfilter/vf_minterpolate.c

index ef47140946adfc57b4b12c5b6c166a95091afbaa..c9ce80420d519f039d70e140c4c3afdde3edef4e 100644 (file)
@@ -834,19 +834,11 @@ static int detect_scene_change(MIContext *mi_ctx)
     ptrdiff_t linesize2 = mi_ctx->frames[2].avf->linesize[0];
 
     if (mi_ctx->scd_method == SCD_METHOD_FDIFF) {
-        double ret = 0, mafd = HUGE_VAL, diff;
+        double ret = 0, mafd, diff;
         uint64_t sad;
-        AVDictionaryEntry *e_mafd = NULL;
-        char *tail = NULL;
-
-        e_mafd = av_dict_get(mi_ctx->frames[2].avf->metadata, "lavfi.scd.mafd", NULL, AV_DICT_MATCH_CASE);
-        if (e_mafd)
-            mafd = strtod(e_mafd->value, &tail);
-        if (*tail || mafd == HUGE_VAL) {
-            mi_ctx->sad(p1, linesize1, p2, linesize2, me_ctx->width, me_ctx->height, &sad);
-            emms_c();
-            mafd = (double) sad * 100.0 / (me_ctx->height * me_ctx->width) / (1 << mi_ctx->bitdepth);
-        }
+        mi_ctx->sad(p1, linesize1, p2, linesize2, me_ctx->width, me_ctx->height, &sad);
+        emms_c();
+        mafd = (double) sad * 100.0 / (me_ctx->height * me_ctx->width) / (1 << mi_ctx->bitdepth);
         diff = fabs(mafd - mi_ctx->prev_mafd);
         ret  = av_clipf(FFMIN(mafd, diff), 0, 100.0);
         mi_ctx->prev_mafd = mafd;