History

avfilter/vf_lenscorrection: fix division by zero

Fixes #8265

Paul B Mahol committed 7 years ago

Commit 19587c91 parent 07050d71 file · +2 −4Browse files

Unified · Split

libavfilter/vf_lenscorrection.c+2−4
@@ -155,10 +155,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 154 unmodified lines
155 for (plane = 0; plane < rect->nb_planes; ++plane) {155 for (plane = 0; plane < rect->nb_planes; ++plane) {
156 int hsub = plane == 1 || plane == 2 ? rect->hsub : 0;156 int hsub = plane == 1 || plane == 2 ? rect->hsub : 0;
157 int vsub = plane == 1 || plane == 2 ? rect->vsub : 0;157 int vsub = plane == 1 || plane == 2 ? rect->vsub : 0;
158 int hdiv = 1 << hsub;158 int w = AV_CEIL_RSHIFT(rect->width, hsub);
159 int vdiv = 1 << vsub;159 int h = AV_CEIL_RSHIFT(rect->height, vsub);
160 int w = rect->width / hdiv;
161 int h = rect->height / vdiv;
162 int xcenter = rect->cx * w;160 int xcenter = rect->cx * w;
163 int ycenter = rect->cy * h;161 int ycenter = rect->cy * h;
164 int k1 = rect->k1 * (1<<24);162 int k1 = rect->k1 * (1<<24);

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