Commit 19587c93 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/vf_lenscorrection: fix division by zero

Fixes #8265
parent 07050d7b
...@@ -155,10 +155,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) ...@@ -155,10 +155,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
for (plane = 0; plane < rect->nb_planes; ++plane) { for (plane = 0; plane < rect->nb_planes; ++plane) {
int hsub = plane == 1 || plane == 2 ? rect->hsub : 0; int hsub = plane == 1 || plane == 2 ? rect->hsub : 0;
int vsub = plane == 1 || plane == 2 ? rect->vsub : 0; int vsub = plane == 1 || plane == 2 ? rect->vsub : 0;
int hdiv = 1 << hsub; int w = AV_CEIL_RSHIFT(rect->width, hsub);
int vdiv = 1 << vsub; int h = AV_CEIL_RSHIFT(rect->height, vsub);
int w = rect->width / hdiv;
int h = rect->height / vdiv;
int xcenter = rect->cx * w; int xcenter = rect->cx * w;
int ycenter = rect->cy * h; int ycenter = rect->cy * h;
int k1 = rect->k1 * (1<<24); int k1 = rect->k1 * (1<<24);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment