1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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

This reverts commit 339593ca90.

Fixes null pointer dereference.

Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint 2020-05-14 22:49:01 +02:00
parent 7f3a946216
commit b4bcae4e0e

View File

@ -71,20 +71,13 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *crnt, AVFrame *next
if (crnt->height == next->height && if (crnt->height == next->height &&
crnt->width == next->width) { crnt->width == next->width) {
AVDictionaryEntry *e_mafd = NULL;
uint64_t sad; uint64_t sad;
double mafd = HUGE_VAL, diff; double mafd, diff;
char *tail = NULL;
ff_dlog(ctx, "get_scene_score() process\n"); 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); s->sad(crnt->data[0], crnt->linesize[0], next->data[0], next->linesize[0], crnt->width, crnt->height, &sad);
emms_c(); emms_c();
mafd = (double)sad * 100.0 / (crnt->width * crnt->height) / (1 << s->bitdepth); mafd = (double)sad * 100.0 / (crnt->width * crnt->height) / (1 << s->bitdepth);
}
diff = fabs(mafd - s->prev_mafd); diff = fabs(mafd - s->prev_mafd);
ret = av_clipf(FFMIN(mafd, diff), 0, 100.0); ret = av_clipf(FFMIN(mafd, diff), 0, 100.0);
s->prev_mafd = mafd; s->prev_mafd = mafd;