History

avfilter/vf_find_rect: Increase worst case score

score could be 1.0 which lead to uninitialized values

Michael Niedermayer committed 6 years ago

Commit 6ff24741 parent 5e621001 file · +2 −2Browse files

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

Unified · Split

libavfilter/vf_find_rect.c+2−2
@@ -159,7 +159,7 @@ static float search(FOCContext *foc, int pass, int maxpass, int xmin, int xmax, · 158 unmodified lines
159159
160160 if (pass + 1 <= maxpass) {
161161 int sub_x, sub_y;
162− search(foc, pass+1, maxpass, xmin>>1, (xmax+1)>>1, ymin>>1, (ymax+1)>>1, &sub_x, &sub_y, 1.0);
162+ search(foc, pass+1, maxpass, xmin>>1, (xmax+1)>>1, ymin>>1, (ymax+1)>>1, &sub_x, &sub_y, 2.0);
163163 xmin = FFMAX(xmin, 2*sub_x - 4);
164164 xmax = FFMIN(xmax, 2*sub_x + 4);
165165 ymin = FFMAX(ymin, 2*sub_y - 4);
@@ -198,7 +198,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 32 unmodified lines
198198 FFMIN(foc->xmax, foc->last_x + 8),
199199 FFMAX(foc->ymin, foc->last_y - 8),
200200 FFMIN(foc->ymax, foc->last_y + 8),
201− &best_x, &best_y, 1.0);
201+ &best_x, &best_y, 2.0);
202202
203203 best_score = search(foc, 0, foc->mipmaps - 1, foc->xmin, foc->xmax, foc->ymin, foc->ymax,
204204 &best_x, &best_y, best_score);

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