History

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

This reverts commit 339593ca90cb3e05d659ec99a1479904ec742294. Fixes null pointer dereference.

Marton Balint committed 6 years ago

Commit b4bcae41 parent 7f3a9461 file · +4 −11Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_framerate.c+4−11
@@ -71,20 +71,13 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *crnt, AVFrame *next · 70 unmodified lines
7171
7272 if (crnt->height == next->height &&
7373 crnt->width == next->width) {
74− AVDictionaryEntry *e_mafd = NULL;
7574 uint64_t sad;
76− double mafd = HUGE_VAL, diff;
77− char *tail = NULL;
75+ double mafd, diff;
7876
7977 ff_dlog(ctx, "get_scene_score() process\n");
80− e_mafd = av_dict_get(next->metadata, "lavfi.scd.mafd", NULL, AV_DICT_MATCH_CASE);
81− if (e_mafd)
82− mafd = strtod(e_mafd->value, &tail);
83− if (*tail || mafd == HUGE_VAL) {
84− s->sad(crnt->data[0], crnt->linesize[0], next->data[0], next->linesize[0], crnt->width, crnt->height, &sad);
85− emms_c();
86− mafd = (double)sad * 100.0 / (crnt->width * crnt->height) / (1 << s->bitdepth);
87− }
78+ s->sad(crnt->data[0], crnt->linesize[0], next->data[0], next->linesize[0], crnt->width, crnt->height, &sad);
79+ emms_c();
80+ mafd = (double)sad * 100.0 / (crnt->width * crnt->height) / (1 << s->bitdepth);
8881 diff = fabs(mafd - s->prev_mafd);
8982 ret = av_clipf(FFMIN(mafd, diff), 0, 100.0);
9083 s->prev_mafd = mafd;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t