Fixes #8265
Unified · Split
| @@ -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); |