avfilter/vf_scale: store the offset in a local variable before adding it

Signed-off-by: James Almer <jamrial@gmail.com>
pull/362/head
James Almer 4 years ago
parent fb5e2d7112
commit 92769f260d
  1. 6
      libavfilter/vf_scale.c

@ -632,10 +632,12 @@ static int scale_slice(AVFilterLink *link, AVFrame *out_buf, AVFrame *cur_pic, s
for (i=0; i<4; i++) {
int vsub= ((i+1)&2) ? scale->vsub : 0;
ptrdiff_t in_offset = ((y>>vsub)+field) * cur_pic->linesize[i];
ptrdiff_t out_offset = field * out_buf->linesize[i];
in_stride[i] = cur_pic->linesize[i] * mul;
out_stride[i] = out_buf->linesize[i] * mul;
in[i] = FF_PTR_ADD(cur_pic->data[i], ((y>>vsub)+field) * cur_pic->linesize[i]);
out[i] = FF_PTR_ADD(out_buf->data[i], field * out_buf->linesize[i]);
in[i] = FF_PTR_ADD(cur_pic->data[i], in_offset);
out[i] = FF_PTR_ADD(out_buf->data[i], out_offset);
}
if (scale->input_is_pal)
in[1] = cur_pic->data[1];

Loading…
Cancel
Save